A planetary nebula is an emission nebula consisting of a glowing shell of gas and plasma formed by certain types of stars when they die. The name originated in the 18th century because of their similarity in appearance to giant planets when viewed through small optical telescopes, and is unrelated to the planets of the solar system. They are a relatively short-lived phenomenon, lasting a few tens of thousands of years, compared to a typical stellar lifetime of several billion years.
At the end of the star's life, during the red giant phase, the outer layers of the star are expelled via pulsations and strong stellar winds. Without these opaque layers, the remaining core of the star shines brightly and is very hot. The ultraviolet radiation emitted by this core ionises the ejected outer layers of the star which radiate as a planetary nebula.
Planetary nebulae are important objects in astronomy because they play a crucial role in the chemical evolution of the galaxy, returning material to the interstellar medium which has been enriched in heavy elements and other products of nucleosynthesis (such as carbon, nitrogen, oxygen and calcium). In other galaxies, planetary nebulae may be the only objects observable enough to yield useful information about chemical abundances.
In recent years, Hubble Space Telescope images have revealed many planetary nebulae to have extremely complex and varied morphologies. About a fifth are roughly spherical, but the majority are not spherically symmetric. The mechanisms which produce such a wide variety of shapes and features are not yet well understood, but binary central stars, stellar winds and magnetic fields may all play a role.