A nebula (from Latin: "cloud"; pl. nebulae or nebulæ, with ligature, or nebulas) is an interstellar cloud of dust, hydrogen, helium and other ionized gases. Originally, nebula was a name for any diffuse astronomical object, including galaxies beyond the Milky Way. The Andromeda Galaxy, for instance, was referred to as the Andromeda Nebula (and spiral galaxies in general as "spiral nebulae") before the true nature of galaxies was confirmed in the early 20th century by Vesto Slipher, Edwin Hubble and others. Nebulae are often star-forming regions, such as in the Eagle Nebula. This nebula is depicted in one of NASA's most famous images, the "Pillars of Creation". In these regions the formations of gas, dust, and other materials "clump" together to form larger masses, which attract further matter, and eventually will become massive enough to form stars. The remaining materials are then believed to form planets, and other planetary system objects.
A planetary nebula, often abbreviated as PN or plural PNe, is a kind of emission nebula consisting of an expanding glowing shell of ionized gas ejected from old red giant stars late in their lives. The word 'nebula' is Latin for mist or cloud and the term 'planetary nebula' is a misnomer that originated in the 1780s with astronomer William Herschel because when viewed through his telescope, these objects appeared to him to resemble the rounded shapes of planets. Herschel's name for these objects was popularly adopted and has not been changed. 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.
A mechanism for formation of most planetary nebulae is thought to be the following: at the end of the star's life, during the red giant phase, the outer layers of the star are expelled by strong stellar winds. Eventually, after most of the red giant's atmosphere is dissipated, the exposed hot, luminous core emits ultraviolet radiation to ionize the ejected outer layers of the star. Absorbed ultraviolet light energises the shell of nebulous gas around the central star, appearing as a bright coloured planetary nebula at several discrete visible wavelengths.
Planetary nebulae may play a crucial role in the chemical evolution of the Milky Way, returning material to the interstellar medium from stars where elements, the products of nucleosynthesis (such as carbon, nitrogen, oxygen and neon), have been created. Planetary nebulae are also observed in more distant galaxies, yielding useful information about their chemical abundances.