A planetary nebula is a glowing shell of gas and dust that forms around a dying star. As the star exhausts its nuclear fuel and sheds its outer layers, the remaining core emits ultraviolet radiation that ionizes the surrounding gas, causing it to glow and form a nebula-like appearance.