Scientists have found electricity flowing in an unexpected place — across the surfaces of rocks.

Mineral coatings on rocks turn sunlight into electricity, turning on like a light switch when the sun hits them, according to a study published April 22 in the journal Proceedings of the National Academy of Sciences.

Plants use photosynthesis to convert sunlight into chemical energy. And solar cells produce electricity through the photoelectric effect, in which sunlight jostles electrons free from atoms, causing current to flow in semiconductors like silicon. But scientists knew very little about natural, non-biological systems that produce electricity.

In the new study, researchers analyzed the the mineral coatings on rocks lying in northern China and coatings on karst — an eroded landscape of limestone — and red soil particles in southern China. [In Images: Mysterious Desert Varnish]

They used microscopes and X-ray spectroscopy— a method that reveals the elements that make up a substance— to figure out that the coatings were full of iron and manganese, two elements that are used in solar cell coatings.

They found that light transformed into electricity inside the coatings, but not in the underlying rock. When the light that hit the minerals changed, the photoelectric currents also shifted rapidly, turning on and off like a light switch, according to a statement.

These natural photoelectric coatings cover vast expanses of desert, karst and red soil particles throughout the world, the authors noted. "The native semiconducting iron/manganese-rich coatings may play a role similar, in part, to photosynthetic systems and thus provide a distinctive driving force" for some of the principal chemical reactions on Earth’s surfaces, the researchers wrote in the study.

Originally published on Live Science.