Image: Hubble views star nearing its end
This image from the NASA/ESA Hubble Space Telescope shows NGC 5307, a planetary nebula that lies about 10,000 light-years from Earth. It can be seen in the constellation Centaurus (the Centaur), which can be seen primarily in the southern hemisphere.
A planetary nebula is the final stage of a Sun-like star. As such, planetary nebulas allow us a glimpse into the future of our own solar system.
A star like our Sun will, at the end of its life, transform into a red giant. Stars are sustained by the nuclear fusion that occurs in their core, which creates energy.
The nuclear fusion processes constantly try to rip the star apart. Only the gravity of the star prevents this from happening.
At the end of the red giant phase of a star, these forces become unbalanced. Without enough energy created by fusion, the core of the star collapses in on itself, while the surface layers are ejected outward. After that, all that remains of the star is what we see here: glowing outer layers surrounding a white dwarf star, the remnants of the red giant star's core.
This isn't the end of this star's evolution though—those outer layers are still moving and cooling. In just a few thousand years they will have dissipated, and all that will be left to see is the dimly glowing white dwarf.