For stars with masses similar to our Sun, the red giant phase culminates in the shedding of the outer layers, creating a planetary nebula. The hot core, now exposed, ionizes the ejected material, causing it to glow and form beautiful, often intricate shapes. The core left behind becomes a white dwarf.