MgCl2 can substitute the toxic CdCl2 in CdTe solar cell processing. Annealing in MgCl2 vapor produce better spatial uniformity for CdTe film. Carrier concentration at the back contact is higher for MgCl2 treated devices. Diffusion of sulfur and alloying at the junction is high in CdCl2 treated device.