The man in the moon might not change from month to month, but the lunar surface didn’t always look this way.

A new NASA video depicts the fiery history of the moon, showing how the familiar shapes we see each night were actually caused by barrages of asteroids and blazing flows of magma.

The moon formed when an enormous, Mars-sized object hit Earth around 4.5 billion years ago. This shot a huge plume of ejecta into space, which within a century coalesced into the round body of the moon.

At its birth, our closest companion would have been extremely hot and covered in a global ocean of magma. When this cooled, it would have left the young moon with a relatively smooth, unblemished surface.

The moon’s untarnished face didn’t last very long. Our early solar system was filled with enormous rocky chunks that wandered menacingly between the newly formed planets. Around 4.3 billion years ago, one of these lumps hit the lunar South Pole, creating the Aitken basin, one of the largest impact craters in the solar system.

The resulting crater is eight miles deep and 1,600 miles wide, large enough to easily swallow the entire Indian subcontinent and hide Mt. Everest from sight. As the video shows, the Aitken impact would have kicked up an enormous amount of material, causing fire to rain down from the sky over the lunar surface.

This event was followed by millions of years of heavy bombardment as leftover bits from the solar system’s formation struck the moon. This formed some of the earliest basins, such as Mare Nectaris, which is seen in the moon’s lower right side at night. (Mare is the Latin word for seas; early astronomers thought the moon’s contained water).

Around 3.8 billion years ago, this and other impacts are thought to have triggered a period of volcanism on the moon. Lava flowed over its surface, excavating more mare and leaving the familiar spots we see on the moon’s Earth-facing side, including the Seas of Tranquility, Serenity and Fertility. Tranquility is was the landing site for Apollo 11’s crew.

After the volcanic activity settled down, the moon continued to sustain smaller impacts. Weathered by the solar wind, its surface grew darker, in some areas turning black.

The moon then entered its final phase, which lasted until about 1 billion years ago. The last remaining chunks from our solar system’s formation continued to hit the moon, saturating its surface with craters. This created the craggy moon we know today. New craters still turn up on the moon, with tiny meteorites creating half-inch-sized craters every few minutes and a new three-foot crater approximately every month.

The moon is unique in that it’s the only body in the solar system other than Earth for which scientists know actual dates of formation for its surface features. Scientists can deduce relative ages of different features based on layering — craters from recent impacts will be superimposed over craters from earlier times — and, thanks to the Apollo mission, radiocarbon-dated surface samples provide absolute reference dates.

This is one of the leading arguments in favor of a Mars sample-return mission: scientists will finally be able to make a definitive timeline of its history.

Video: NASA Goddard