Scientific American reports that a unit of energy from conventional solar cells is cleaner and (after three-to-four years) cheaper than a unit of energy from fossil fuel sourceseven when the dirty energy used in their production is taken into account. Emerging solar technologies will increase the economic and environmental lead of solar generation even further. The article states

These four types of solar cells pay back the energy involved in their
manufacture in one to three years, according to an earlier analysis by
the same team. And even the most energy-intensive to
produce—monocrystalline silicate cells with the highest energy
conversion efficiency of 14 percent—emit just 55 grams (1.9 ounces) of
globe warming pollution per kilowatt-hour—a fraction of the near one
kilogram (2.2 pounds) of greenhouse gases emitted by a coal-fired power
plant per kilowatt-hour.

Even though thin-film solar PVs employ heavy metals such as cadmium
recovered from mining slimes, the overall toxic emissions are “90 to
300 times lower than those from coal power plants,” the researchers
write in Environmental Science & Technology.