(CNN) - NASA scientists found that when solar wind rains down the lunar surface at a certain speed the particles can interact to make hydrogen and oxygen, two components of water.
NASA calls the surface of the moon a "chemical factory" after the discovery, saying every rock has the potential to make water.
They used a computer program to simulate how water could be created.
“We think of water as this special, magical compound,” said William M. Farrell, a plasma physicist at NASA who helped develop the simulation. “But here’s what’s amazing: every rock has the potential to make water, especially after being irradiated by the solar wind.”
It's part of NASA’s ongoing efforts to send humans to the moon to establish a permanent home there.