95% of all stars that we see in our own galaxy, the Milky Way, will ultimately become "planetary nebulae". This includes the Sun.
Much as a butterfly emerges when its chrysalis is ejected, planetary nebulae are formed when a red giant star ejectes its outer layers as clouds of luminescent gas, revealing the dense, hot, and tiny white dwarf star at its core.
The other 5% of starsthat is, those born with masses more than eight times larger than our Sunend their lives as supernovae.
One final note: the name "planetary nebula" is a misnomer. The name arose over a century ago when early astronomers looking through small and poor-quality telescopes saw these objects as compact, round, green-colored objects that reminded them of the view of Uranus.
However, "planetary nebulae" are not made of planets, and no planets are visible within them. Rather, they are the gaseous and dusty material expelled by a geriatric star just before death. A far better name for these objects would be "ejection nebulae." Think of ejection nebulae as a cloud of smoke which esacpes from a burning log as it collapses and crumbles into embers.
THE LIFE OF A STAR LIKE THE SUN
The Sun generates all of its heat in its core. This heat both warms the Earth and prevents gravity from forcing the Sun to undergo a catastrophic gravitational collapse. The fuel which supplies the heat is hydrogen. Hydrogen nuclei are converted to helium as heat is released.
In five billion years the hydrogen fuel will have been depleted. Gravity will force the spent core, now almost pure helium, to shrink, compress, and become even hotter than at present. The high temperatures will eventually ignite the helium ashes. The result is carbon nuclei and even more heat. The "second wind" of heat release will be furious, increasing the light emitted from the future Sun's surface by a thousand fold. Meanwhile, the same heat will cause the outer layers of the present Sun to expand and form a huge "red giant".
The red giant is so bloated that Mercury and Venus will find themselves orbiting inside of it. Imagine daytime on the Earth when this happens. Sunrises and sunsets will take hours, thanks to the huge apparent diameter of the swelled Sun. At noon the huge bright red Sun will fill half the sky. The view won't be very different than that within a kiln. The oceans will boil and evaporate into space, along with the atmosphere. The intense radiant heat will transform the surface to a thick layer of pottery. In all, a biblical view of hell.
As stellar time goes, the helium won't last longcertainly less than a mere few hundred million years. With its helium transformed into unburnable carbon, the solar core shrinks suddenly (a few thousand years) until just over half the mass of the present Sun is packed into a hot (million degree), dense (a ton per teaspoon) ball the size of the Earth. This amazing stellar remnant is called a white dwarf.
The remnant's fuel reserves are now finally gone. Its shrunken stellar core is now entering retirement. Even so, one large final fling lies ahead for this star.
The story shifts from the dying core to the star's distended outer layers. The core, their underlying foundation, now has all but imploded. The outer layers of the Sun fall inward toward the core. But the base material ignites on the way in, causing the outer surfaces to bounce and vibrate. Eventually the outer 40% of the Sun's mass will be spasmically "coughed" into space, floating outward through the solar system and beyond in a concetric set of spherical bubbles. Seen from far away, these may eventually blend together into a gigantic stellar "halo." As the outer layers are flung outward increasingly deeper and deeper layers of the Sun become exposed as its outermost surface, like peeling an onion.
When the process ends, the former core of the Sun emerges through its exapnding veil of ejected material as a white dwarf. The highly energetic forms of light emitted by the hot white dwarf interact with the electrons attached to the atoms in the gas cloud, resulting in a colorful nebula much like the thousand planetary nebulae that have been catalogued already. The striking symmetries of these objects have led to an array of popular names such as the "Cat's Eye," "Ring," "Eye of Jupiter," "Eskimo," "Saturn," and "Blue Snowball" nebulae.
IMAGINE THE VIEW!
Here on Earth, we'll feel the wind of the ejected gasses sweeping past, slowly at first (a mere 5 miles per second), and then picking up speed as the spasms continue (eventuially to reach 1000 miles per second!) The remnant Sun will rise as a dot of intense light, no larger than Venus, more brilliant than 100 present Suns, and an intensely hot blue-white color hotter than any welder's torch. Light from the fiendish blue "pinprick" will braise the Earth and tear apart its surface molecules and atoms. A new but very thin "atmosphere" of free electrons will form as the Earth's surface turns to dust.
Here's what some survivor will observe in the night sky. Obviously our own planetary nebula will be viewed from the inside out. In addition to stars, the sky will be aflame with the whispy, colorful shapes of the nebula of ejected solar material. This spectacular show will last a few thousand years as the ejected gasses merge into the interstellar medium from which new generations of stars will form.
Imagine that we lived, not for a hundred years, but for a hundred million. As we viewed our home galaxy, the Milky Way, we would see these "planetary", or ejection nebulae flaring and fading all the time, about one per Earth year, much as the flashes of cameras at a sports stadium at night. At any given instant more than 10,000 nebulae are visible in some stage of their evolution. (Once per century or two a blinding supernova would appear for a week or two, like a powerful firecarcker.)
Planetary nebulae make the Milky Way come alive. From afar the Milky Way would resemble a scintillating galactic Christmas tree. A red flash appears here, and another there, as planetary nebulae form. For a few thousand years each nebula brightens and turns from red to green. Finally, after 10,000 years, the growing nebula will expand and fade into the background of galactic gas, as does air from a popped balloon. Each nebula leaves behind a tiny blue white dwarf. Over the course of billions of years, a "white" dwarf fades to a dull red ember.