One day, the Sun will die.

Our beautiful star can't last forever. Eventually the elements that fuel its fusion will run out, and Sol will undergo the wild transformation into a white dwarf – puffing up into a red giant whose radius might reach as far as Mars before ejecting its outer material as its core collapses into a stellar remnant that shines only with the heat left over from its death.

We have a pretty good idea of how this will go for the Sun itself, kicking off in about 5 billion years. But the planets – what about them? What about Earth? What about us?

Led by physicist Amornrat Aungwerojwit of Naresuan University in Thailand, a team of scientists has analyzed long-term changes in brightness for three white dwarfs, and extrapolated what that means for the planetary systems around them.

Fortunately we can rest assured that humanity (and whatever we evolve into) will be long gone by then, extinct if not living it up elsewhere in the cosmos. But this beautiful blue marble we call home, and other planets, will not escape unscathed. According to the analysis of white dwarf stars, the death throes of the Sun are going to unleash Solar System carnage.

In short, Mercury and Venus are goners, as is anything else in the innermost circle of the Solar System. They're going to end up torn apart and devoured by the Sun, slurped down like planet spaghetti.

Earth may or may not survive, depending on how its orbit changes with respect to the Sun's shrinking mass and shifting interactions between the planets. If it does narrowly escape, it will look very different from the lush, habitable world it is today.

"Whether or not the Earth can just move out fast enough before the Sun can catch up and burn it is not clear," says physicist Boris Gänsicke of the University of Warwick in the UK, "but [if it does] the Earth would [still] lose its atmosphere and ocean and not be a very nice place to live."

How can we tell all this from looking at white dwarf stars? By studying changes in their brightness.

Fluctuations in starlight can mean a few things, but if they're regular, the rise and fall in intensity can suggest something is orbiting the star, periodically blocking some of its light.

The three stars analyzed by the researchers in this latest study have changes in brightness that previous research suggests is produced by orbiting clouds of planetary debris.

"Previous research had shown that when asteroids, moons, and planets get close to white dwarfs," Aungwerojwit says, "the huge gravity of these stars rips these small planetary bodies into smaller and smaller pieces."

An artist's impression of clouds of debris orbiting a white dwarf, and causing it to dim. (Dr Mark Garlick/The University of Warwick)

By studying 17 years' worth of data on their three very different white dwarf stars, the researchers were able to put together a picture of how this process can evolve. All three stars showed signs of transits – dips in starlight – consistent with giant, irregular clouds of debris getting pulverized into smaller and smaller dust before disappearing, probably because the clumps of dust and rock were being slurped into the white dwarf.

One star showed signs of some sort of catastrophic event in 2010, another in 2015. The third star had irregular dimming events every few months, and chaotic fluctuations on the scale of minutes. All three stars are now behaving perfectly normally, with the transit events no longer occurring.

This suggests that planetary dismemberment and devouring happens pretty quickly. But if Earth is fated for destruction, it's unlikely to be quite so violent.

"The sad news is that the Earth will probably just be swallowed up by an expanding Sun, before it becomes a white dwarf," Gänsicke says.

"For the rest of the Solar System, some of the asteroids located between Mars and Jupiter, and maybe some of the moons of Jupiter may get dislodged and travel close enough to the eventual white dwarf to undergo the shredding process we have investigated."

Not to worry, though. Earth's oceans are going to boil away in about a billion years, long before the Sun gets to that point.

The research has been published in the Monthly Notices of the Royal Astronomical Society.