Relevance. In the case of bombardment with Mg metal ions, the changes are accompanied by the introduction of metal atoms and the formation of various types of compounds. Thus, CdF2 is intensively decomposed into components in the near-surface layer in the process of ion implantation. A small part of these components can be sprayed from the surface. Due to the high chemical activity, almost all of the liberated fluorine atoms again enter into a chemical bond with both the atoms of the alloying element and the atoms of cadmium. Consequently, three-component compounds are formed in the near-surface layer. Therefore, it is necessary to define the electronic states, band energy, and optical parameters of CdF2 and Cd0.6Mg0.4F2 films. Purpose. The composition, structure, and properties of CdF2 implanted with Mg+ ions in combination with thermal and laser annealing for the first time were the research aims. Methodology. The experimental studies were carried out at a vacuum of at least 10-7 Pa using the methods of Auger electron spectroscopy (AES) and ultraviolet photoelectron spectroscopy (UVES). The depth distribution profiles of atoms were determined by the AES method in combination with layer-by-layer etching of the surface with Ar+ ions with E0=2-3 keV. Results. CdF2 is intensively decomposed into components in the near-surface layer in the process of ion implantation. Consequently, three-component compounds are formed in the near-surface layer. Band-energy parameters and densities of the state of electrons in the valence band of this film are determined. Conclusions. The effect of the implantation of Mg+ ions on the composition and electronic structure of single-crystal CdF2/Si(III) films was studied for the first time. The densities of electronic states, band-energy and optical parameters of CdF2 and Cd0.6Mg0.4F2 films have been determined