We have grown the ternary alloy Cd1-xMgxTe as well as Cd1-xMgTe/CdTe quantum well structures by molecular beam epitaxy - to our knowledge for the first time. Cd1-xMgxTe exhibits some very interesting features: The band gap has been determined as a function of Mg concentration, and a band gap of 3.0 eV was found for zincblende MgTe at room temperature. Cd1-xMgxTe thin films with Mg concentrations of up to 0.75 were fabricated, which corresponds to a band gap of 2.8 eV at low temperatures. Therefore, the whole visible band gap range (at room temperature) can be covered with Mg concentrations between 0.30 (red) and 0.75 (blue). Bulk MgTe crystallizes in the wurtzite structure, but zincblende MgTe could be grown on (100) oriented CdTe substrates up to a layer thickness of approximately 500 nm. The lattice mismatch between zincblende MgTe and CdTe was found to be as small as 1.0%. The growth of cubic MgTe could be followed by reflection high energy electron diffraction (RHEED) oscillations. In general, excellent structural quality could be reached, which is demonstrated by the FWHM of 22 arc sec for a Cd1-xMgxTe thin film with 0.44 Mg concentration on a Cd1-xZnxTe nearly lattice matched substrate. The Poisson number of Cd1-xMgxTe has been determined by X-ray diffraction as a function of Mg concentration. Cd1-xMgxTe/CdTe single quantum well structures have been fabricated with a large confinement energy of up to 0.8 eV. The photoluminescence spectra show exciton lines with very narrow linewidths. We are able to observe excited exciton states, and from the energetic difference between 1s and 2s heavy hole exciton lines we deduce exciton binding energies. Very bright luminescence could be seen even at room temperature, which is an indication of a large exciton binding energy and an effective radiative recombination.