On Mercury, the Sun appears more than three times its size and seven times brighter than on Earth. As the closest planet to the Sun, Mercury’s temperatures soar to a scorching 430 degrees Celsuis during the daytime.

That is hot. But it isn't so hot that water ice cannot still form on the planet's surface. And now, scientists think they have discovered how Mercury manages to be both one of the hottest places in the Solar System and yet still have surface ice.

The reason may be to do with the wild temperature swings Mercury experiences over the course of its day: As night falls on the planet, Mercury reveals its more chill side, with temperatures dropping below minus 180 degrees Celsuis.

This extreme variation in temperature could be the main driving force behind Mercury’s hidden supply of ice.

The variation in temperatures on Mercury act as a "gigantic ice-making chemistry lab," according to the researchers of the new study.

Researchers detail the counterintuitive finding in a study published Monday in the Astrophysical Journal Letters. In the study, the researchers present a model for how water can be found on even the hottest planet — and argue that the extreme heat may be the key.

Mercury's extreme temperatures could be the source of ice water on this hot planet. NASA

It’s all in the chemistry

For the study, the researchers used data on the surface chemistry of Mercury to create their model.

The planet’s surface soil contains minerals with hydroxyl groups, which consist of one hydrogen and one oxygen atom. The extreme heat of Mercury’s daytime separates the atoms, and then energizes them enough to collide with one another, producing water molecules.

These water molecules free float through the planet. Some are broken down by the extreme sunlight or evaporate into the atmosphere. But some of the molecules float onto areas of Mercury’s surface that are hidden from the sunlight, including the nooks and shadows of the planet's polar craters.

Because Mercury has no atmosphere, the planet itself generates no heat. Shielded from the Sun's fierce rays, these hidden water molecules turn to glacial ice.

"It's a little like the song 'Hotel California,'” Thomas Orlando, a professor at Georgia Tech's School of Chemistry and Biochemistry and lead author of the study, said in a statement.

“The water molecules can check into the shadows but they can never leave."

Essentially, the water accumulates in the shadows, the study suggests. Over a period of 3 million years, around 11,023,110,000 tons of water molecules may turn to ice, according to the study. That accounts for around 10 percent of the total ice found on Mercury.

Icy, hot planet

Aside from the Sun, Mercury seems like the least likely place to host water in the Solar System. But scientists think billions of tons of water ice are stored in the shadows of the scorching hot planet.

Early radar-imaging of Mercury done from Earth revealed areas with high-radar reflectivity near the planet’s south and north poles — a sign of ice. The observations were confirmed as no fluke in 2012, when NASA’s MESSENGER (MErcury Surface, Space ENvironment, GEochemistry, and Ranging) spacecraft picked up signals of glacial ice during its orbit of the planet.

Images of Mercury's north pole acquired by MESSENGER reveal its icy deposits. NASA/Johns Hopkins University Applied Physics Laboratory/Carnegie Institution of Washington/National Astronomy and Ionosphere Center, Arecibo Observatory

To survive on Mercury, the water ice appeared to be stored in pockets on the planet’s poles that never see the light of day.

Shockingly, the amount of water ice found on Mercury is far more than the water ice found on the Moon. That left scientists wondering what was going on.

It is now believed that water ice was delivered to the Moon through impacts by asteroids and comets, which contain water in their rocky core.

But the surplus of ice on Mercury had to have come from a second source, one that wouldn’t really work on the Moon since it doesn’t have as much heat as Mercury to kick off this intricate chemical process. The new findings finally put that conundrum to rest.

Intriguingly, the scientists behind the new study believe that the chemical process taking place on Mercury could also be behind the origin of water ice on comets and asteroids. If that is true, then it could help explain how other bodies in the Solar System became seeded with water, although more research is needed to confirm the theory.