Sun
The Sun will absorb the Earth when it dies. Pictured: In this handout from NASA, a solar eruption rises above the surface of the sun December 31, 2012 in space. Getty Images/NASA/SDO

Stars are born and die all the time, but what happens if the Sun in our solar system is the one that dies? Apparently, it will expand into a red giant and vaporize the Earth.

The Sun won't die anytime soon as it is estimated to go out in around 7 to 8 billion years from now. However, the topic of such an essential part of life dying has always fascinated humans and will probably continue to do so in the future, mainly due to the fact that we know we will all disappear the moment the Sun isn't there anymore.

So what exactly happens when the Sun dies? First, we need to look at how stars are born. These celestial bodies are created out of a collection of gas, mostly hydrogen with some helium and other elements, according to Live Science.

The massive amounts of gas eventually collapses in on itself under its weight, creating enough pressure to heat up the gas within the interior of the proto-star. It gets hot enough to form plasma, which is a state of charged or ionized gas. Hydrogen atoms fuse with each other to form helium, and this fusion unleashes energy in the form of light and heat. At this point, the gas no longer collapses, thus creating a new star.

The hydrogen in a single star would be enough to sustain it for billions of years. However, it will eventually run out. Once nearly all the hydrogen in the Sun's core has fused into helium, it won't be able to produce as much energy and will begin to collapse under its own weight. The Sun won't be able to fuse helium together like it did with hydrogen, so only the remaining hydrogen will continue fusing together to maintain the Sun's illumination.

However, the helium core will begin to break down, which causes it to heat up due to increased pressure. The light and heat produced from this process will make the Sun shine even brighter. But this will also mark the start of the Sun becoming a red giant. Red giants are much bigger but have a much lower surface temperature than stars like our Sun right now.

Around 5 million years after the helium core starts collapsing, the Sun may get so massive that its outermost surface layer will extend to around 108 million miles (170 million kilometers), according to a study by astronomers Klaus-Peter Schröder and Robert Connon Smith published in the Monthly Notices of the Royal Astronomical Society in 2008.

With this range, it could swallow up the planets nearest to it, which are Mercury, Venus and Earth, like in this artist's image of the Sun's death.

During the process, the Earth will resemble a steam bath as our oceans will evaporate and water will return to being hydrogen and oxygen. The hydrogen will leave the Earth's atmosphere and enter space, while the oxygen will react with surface rocks. Due to this, the Earth's atmosphere could become similar to Venus' in that mostly nitrogen and carbon dioxide will make it up.

If you're thinking that we might be living on Mars by the time and thus will be safe from the Sun's effects, the Red Planet won't manage to avoid being baked. Even Neptune will be too hot to sustain life once the Sun becomes a red giant. The only possible planets we could inhabit would be Pluto and other dwarf planets in the Kuiper Belt.

According to Schröder and Smith, however, there is a possibility for Neptune to become a new home for mankind. The Sun, like other stars similar to it, will gradually lose mass due to the solar wind. The orbits of planets around it will slowly expand, thus putting Neptune out of the danger zone.

As for what happens to the Sun after it dies, a previous study published in the journal Nature Astronomy showed that it will eventually become a white dwarf and then a planetary nebula.