A nebula is a huge region of gas and dust in space. Some nebulae are places where new stars are forming, while others are made from material expelled by dying stars. The gas can be illuminated by nearby stars, causing some nebulae to glow brilliantly across the night sky.
Inside some dense molecular clouds, gravity slowly pulls gas and dust together. As material collapses, the center becomes hotter and denser. Eventually, a protostar forms and can develop into a new star. These stellar nurseries can contain thousands of young stars.
Not every nebula is a birthplace. When some stars reach the end of their lives, they eject material into space. Massive stars can explode as supernovae, creating expanding clouds of gas and dust. Other stars create planetary nebulae as they shed their outer layers.
Different gases emit light at different wavelengths. Hydrogen, oxygen and other elements can produce characteristic colors when they are energized by nearby stars. The colors seen in astronomical images can also be enhanced or assigned to different wavelengths to reveal structures that human eyes cannot see directly.