Last week I talked about how the Sun works, and how it formed in the first place. If you haven't read that post, you might want to read it now after all. Because this one more or less follows it, and I'll assume you've read it so I don't annoy people who did by explaining things twice.
I talked about how the Sun gets its energy from fusing hydrogen into helium, preventing gravity from collapsing it further with the energy produced in the core. Yet I didn't touch an important question: what happens when the hydrogen runs out?
Well, the good news is that that won't happen for a long time. The Sun has been fusing hydrogen for five billion years, and is only halfway through its supply. The Sun still has five billion more years left before its hydrogen runs out. An amount of time like that can't be imagined at all, really. In that time, the entirety of life on Earth happened; all of human civilisation could be repeated 500000 times in it. Think of the oldest person you know; perhaps a grandparent, or a parent, or just someone else. Imagine how many seconds their life has lasted so far. Well, take double that amount, but take years instead of seconds, and you've got five billion years. And that's the amount of time we'll have to go into the future to see what happens when the Sun runs out of fuel.
I can't even begin to speculate what Earth looks like this far into the future, but let's assume it's still there at least. If humans still have any descendants now, they probably look nothing like us any more. The first thing you should realise is that the Sun running out of fuel doesn't mean the Sun now consists of 100% helium. In fact, most of the Sun still consists of 75% hydrogen and 24% helium. However, all this hydrogen does the Sun no good: the pressure and temperature simply aren't large enough to overcome the powerful electric repulsion the atoms have for each other in most of the Sun. In the only place where it's so hot and so compressed hydrogen atoms can collide - the core - there is only helium left by now. You'll recall a hydrogen nucleus consists of one positive particle named a proton, while a helium nucleus consists of two protons and two non-charged particles named neutrons, all held together by a powerful force named the strong nuclear force. Helium's two protons repel other helium more strongly than hydrogen's single proton repels other hydrogen, and this means the helium nuclei don't collide yet.
So what happens? Gravity, for the first time in ten billion years, can compress the Sun's core further, so it begins to shrink. The pressure increases, the helium is pressed even more closely together, and as a result the core's temperature rises. The core gets smaller and smaller and hotter and hotter, and this increased heat warms up the layer around the core. While this layer was of course always millions of degrees hot, it never was quite hot enough for nuclear fusion, so it still consists mostly of hydrogen. But as the temperature here increases, hydrogen starts to fuse in this layer around the core. Crisis averted, you may think. Unfortunately, it's not averted.
You see, this shell of fusing hydrogen now holds up the outer layers of the Sun just like the core did, but with an important difference: the non-fusing core still lies under it, and it's still contracting. It's not just getting smaller from the pressure of its own gravity, but also from the energy produced all around it. So the core keeps shrinking and heating up, and in doing so it also continues to heat up the shell where fusion now takes place. When the Sun was fusing hydrogen in its core, it did so at about fifteen million degrees, but now in the shell around the core, it could easily be fifty million degrees. At this higher temperature, the hydrogen atoms bounce around even more rapidly and powerfully, and therefore they collide more often. Much more often. The shell fusion burns through its supply of hydrogen way faster than the core did, and creates far more energy. A thousand times more energy, possibly even ten thousand times more! The Sun used to be a 385 Yottawatt lightbulb, but now it's becoming a 3850000 Yottawatt one.
This enormous increase in energy causes the outer layers of the Sun to be pushed away. The fusion energy pushing from inside always used to balance out with gravity, but now it's getting much stronger, making gravity lose temporarily. The Sun's outer layers expand, and so the Sun grows larger. And as it grows, the energy produced inside, while much greater than it used to be, is spread out over a far bigger surface than it used to, and this means every square kilometre of surface gets less energy than it used to and cools down. As the Sun grows several times as large as it used to be, its nearly white light becomes more pronouncedly yellow. As it keeps expanding further and further, the Sun cools down further, slowly going orange.
At about this point, Mercury meets its fiery maker as the Sun's surface expands beyond its orbit. The rocky little world melts as the Sun's surface gets closer, and finally gets engulfed by it. Yet it survives as a single piece of molten rock, still orbiting inside the Sun, for a surprisingly long time: as the Sun expanded, its mass didn't increase, so its outer layers have become incredibly sparse: it's the same amount of Sun, just spread out over a far larger space. The Sun's sparse outer layers still erode Mercury and slow down its orbit so it falls deeper into the Sun, making it reach warmer and denser layers where it will truly be destroyed, but this will take a long time.
And the Sun keeps expanding: Venus soon shares Mercury's fate as it too gets engulfed by the ever-huger star, which is now a fiery red. So what about Earth? Well, eventually the Sun's expansion stops, and this will be a bit outside Earth's current orbit. So that seems to be the end of the world, but there's a 'but': as the Sun's outer layers grow, they become very tenuous and get very far away from the centre of its gravity. Combined with their heat, the Sun is leaking lots of gas now, and getting lighter in the process. The Sun getting lighter causes its planets to move into higher orbits, and this might just be enough to save Earth. As knowledge stands now, there seems to be about a fifty-fifty chance of Earth following Mercury and Venus in or it orbiting just above the Sun's surface. I'll assume it survives for the rest of this post.
Not that that will actually save it: the Sun increased in brightness by at least a thousand times, so while the Sun's surface is only half as hot as it is now, its proximity and size still roast the Earth. The oceans boiled away, the atmosphere heated up so much the planet's gravity couldn't hold it down any more, and eventually the surface itself, as well as the Moon's, melts. Seen from this molten world, the Sun would fill almost the entire sky; a gigantic red ball of fire. Its surface wouldn't be nearly as bright as it is now, though; you could probably look straight into it while squinting, and even see darker spots on it with the naked eye. However, its enormously increased size in the sky still makes it far brighter than it ever was, even if you can now look into it.
Even aside from its colour and dimmer surface, the Sun wouldn't look much like it used to. The outer layers now contain gigantic convection cells which take material from as deep as the hydrogen-fusing shell and take it all the way to the surface, while gas at the surface gets submerged and taken into the deep. These gigantic convection cells and the Sun's gravity's tenuous hold on its distant surface make the Sun bubble and bulge like a boiling pot of water, even distorting its shape: the Sun no longer is a sphere, but an odd, more-or-less-round bulgy thing. The Sun is now a red giant.
(Image made using SpaceEngine)
The core, meanwhile, has reached a pressure so incredibly high it simply can't get any smaller. The helium is squeezed so incredibly tightly together it really can't get any closer without “breaking” the particles. In stars several times heavier than the Sun, this will actually happen and cause extremely strange things to happen. But the Sun's mass isn't big enough to pack the helium any tighter. You might think the helium will begin fusing too at some point if it's this close together. And you're right: it does. Two helium nuclei collide on occasion, and form a nucleus with four protons and four neutrons named Beryllium-8. There's just one problem: Beryllium-8 is a very unstable nucleus. The strong nuclear force just doesn't seem to have a good grip on it, and within a fraction of a second, it falls apart into two helium nuclei again. So the helium-fusion isn't going anywhere.
In the shell around the core, hydrogen fusion happens at an incredible rate. The Sun's days of slow and stable fusion are over; the hydrogen in the shell around the core gets squandered a thousand times faster than the core hydrogen was. Within only a few million years, the hydrogen here is gone too, and gravity once again has free play. The entire Sun's mass once again rests on the core, which is already as small as it could be, and now surrounded by a layer of new helium. This causes the core to heat up even further.
When the core reaches a hundred million degrees, something happens. The helium, which has occasionally been fusing with other helium to form beryllium-8, reaches a point where fusion is so common that it becomes possible for the beryllium-8 formed in the fusion of two helium nuclei to be hit by another helium nucleus before it decays. The third helium nucleus adds to the nucleus so that it has six protons and six neutrons; it's become carbon. And carbon is quite stable: you should know, as you mainly consist of the stuff. Sometimes, the carbon gets hit by a fourth helium nucleus, fusing to form oxygen. The fusion of three helium nuclei to carbon – or four to oxygen - creates a great deal of energy, and in the strange conditions that now rule in the Sun's core, this energy immediately sets off more helium fusion, which causes more helium fusion in a chain reaction that makes the Sun burn through a fifth of its helium in a single moment called the helium-flash.
The helium-flash is incredibly energetic, and makes the core expand, yet the Sun is so huge and distended by now it's barely noticeable by the time the flash reaches the surface. But after the helium-flash, the Sun's core continues fusing helium in the core at a slower pace. With fusion once again taking place in the core, the Sun's energy production lowers, and gravity contracts the red giant it has become. It looks like the Sun might be returning to its old days: it shrinks, becomes hotter, and since gravity has a stronger hold on the smaller surface, the convection cells stop making the Sun look like a bulgy bubbling mess. It once again becomes smooth and round and yellowish. The Sun doesn't shrink down all the way to its old size, but for a while, it has entered a second youth.
But this second youth doesn't last as long as the first. Not only does the Sun still burn much brighter than it used to, squandering its resources rapidly, but helium fusion also produces far less energy than hydrogen fusion, and therefore happens quicker to produce the same energy. The Sun's second youth lasts about fifty million years before trouble arises once again as all the helium in the core has fused to carbon and oxygen. The core contracts to its absolute limit once again, this time causing helium to fuse in the shell around it. But the helium-fusion in the shell around the core produces so much heat that in another shell around the first shell, hydrogen is also fusing to helium now. The Sun's inside is a bit like an onion now, with all these layers, and its heat quickly makes it grow to a red giant again. But this time, its growth doesn't make it reach a stable endsize: the Sun keeps growing and shrinking alternately. That's because the helium fusion is very sensitive to temperature, and in the shell where helium fuses to carbon and oxygen, the temperature varies. This causes the Sun's energy output to fluctuate wildly, and with it, the Sun's outer layers contract and expand rapidly.
Every time the Sun expands, it loses a lot of gas. The outer layers are just too far away from the core; there is very little gravity working on them at this distance. So the hot gas escapes from the Sun's gravity, expanding and cooling down like a smoke ring. Every few weeks or months, the Sun expands and contracts again, and every time it blows a bit of its own outer layers away. A heavier star will eventually begin to fuse carbon and oxygen to neon, magnesium, sulphur, and silicon; and then fuse silicon and sulphur to iron and create all the other light elements in the periodic table before exploding in an explosion brighter than an entire galaxy, in which heavier elements like gold and uranium are also formed. But our Sun isn't heavy enough to reach the 600 million degrees needed to fuse carbon or oxygen, and slowly blows its outer layers away instead, creating a beautiful nebula around our Solar System.
(Image credit: NASA and ESA)
As the Sun loses its mass, the fusion in the core slows down, with gravity pulling less hard. The core cools down as the pressure decreases. Over the course of millions of years, fusion eventually stops entirely, as all that's left of the Sun is the core: an incredibly dense thing the size of the Earth consisting mainly of carbon and oxygen. It glows a fierce white-bluish from its heat, but it's so tiny that the Earth now cools down deep below freezing, its Sun becoming a single bright point of white light in the sky. The Sun has become a white dwarf, and there's nothing left for it to do but to slowly cool down over billions of years. The white dwarf slowly becomes cooler and fainter, its white light eventually fading to yellow. Then orange, and then it only shines a very faint red light. Eventually that last light dims too, and all that's left is a cold, dark dense object called a black dwarf. The Sun is dead.
But the universe is still young. Stars continue to be formed, and the nebula that was once the Sun's outer layers - a very sparse cloud of mainly hydrogen and helium, with a bit of the carbon and oxygen fused by the Sun - mixes with other similar clouds, and becomes part of new suns, and their solar systems. The silicon and iron Earth consists of, the carbon in our bodies, the nitrogen and oxygen in our air, were all once created inside a star. Only hydrogen and helium were formed in the Big Bang; all the heavier elements come from stars. Carl Sagan used to say: “We're made of star-stuff.” And the Sun's atoms too will become part of worlds of star-stuff in the far future.