We present our work on development of Cd1-xMgxTe (CMT) polycrystalline thin film for solar cells for tandem cell applications. CMT thin films were fabricated by co-evaporation of CdTe and Mg at a substrate temperature of 400˚C. The spatial separation of the two sources resulted in a compositional gradient, which allowed the deposition of a wide range of compositions from fewer runs. Stable films for compositions up to x=0.73 were fabricated. The structural analysis showed that the as-deposited films have a sphalerite structure and are preferentially oriented in the <111> direction, and the lattice constant varies linearly with composition. Optical analysis of the samples shows that the optical bandgap varies linearly with composition. The optical absorption coefficient of the alloy films for the entire composition range (up to x=0.73) is over 6×104/cm-1 for energies above the bandgap, indicating a direct-gap semiconductor. We have fabricated solar cells using these films with the following structure: glass / SnO2 / CdS / CMT / back contact. Using the same processing conditions used for CdTe solar cells, the device efficiency was less than 2%. With modified contact processing, we were able to improve efficiencies to over 5%. Post-deposition chloride heat-treatment in oxygen ambient resulted in partial dissociation of the CMT alloy and loss of Mg. With modified chloride processing, we were able to reduce alloy decomposition and further improve the efficiencies. We have obtained devices with open-circuit voltages of up to 845 mV and efficiencies of 8% for CMT devices with a bandgap in the range of 1.6-1.62 eV which are highest reported values for CMT alloys.