There is no time in a star's life when it isn't beautiful. They are beautiful when they form, they are beautiful when they shine, and they are beautiful — perhaps especially beautiful — when they die.
When a star like the Sun (and up to about 8 times its mass) dies, it expands hugely, becoming a red giant, and blows off a series of gaseous and dusty winds into space, creating fantastic and wondrous shapes. These winds are made from the star's outer layers, so when they blow off they reveal the hot, dense core of the star, now a white dwarf. That can be in excess of 100,000°C, and blasts out ultraviolet light which energizes the gas surrounding it, lighting that material literally like a neon sign.
The result is a planetary nebula; a mundane name for a jaw-droppingly gorgeous object… especially when seen by Hubble Space Telescope.
Behold, NGC 6302!
Yeah. This nebula is pretty young as they go, about 2,200 years old as we see it now, and about 4,000 light years away. Roughly speaking, when the light we see here was emitted by the nebula, the Middle Kingdom of Ancient Egypt was just getting started. Planetary nebulae (or PNe) only exist for about 10,000 years before their expansion thins them out so much the gas becomes invisible, so we're catching this one while it was still pretty young.
The star that died was probably 3-5 times as massive as the Sun, leaving behind an especially hot white dwarf. It blew off a thick, slow wind for a long time, and as deeper layers of the star were exposed the wind became thinner and faster. The second wind caught up and slammed into the slower wind; the blobs you see in the outer parts (in teal) are shaped partly by that interaction, as well as by the fierce light of the star eating away at the material (note how the longer fingers of material all point toward the center).
But there's more going on here. The overall shape of the nebula is bipolar, like an hourglass. We think these form when there are two stars in the center, a binary star. If they orbit each other closely enough, the star that dies can engulf the companion star as it expands; as the smaller star orbits inside the bigger one it spins it up like an eggbeater whipping a bowl of eggs. A thick dusty ring and/or disk forms along the equator (which you can just glimpse in that image above) and the wind from the dying star blows up and down, away from that disk.
Sometimes jets of material are shot out by the companion star, and these rotate around in a process called precession, like the axis of a top making a slow circle as the top spins. This excites the gas even more, creating an elongated S-shape as it hits the gas. You can see that much better in this image using selected filters:
The red color is from excited iron, which is common when gas slams into more gas, creating a shock wave that heats the iron atoms.
Hubble also observed the planetary nebula NGC 7027, another young (~1,300 year old) one about 3,000 light years away:
Cool. And very different than NGC 6302! In this case the nebula itself is the roughly elliptical box (in pink) in the middle. It's surrounded by concentric shells of gas, possibly due to periodic eruptions from the star as it dies. Filaments of dust (red) envelope it, too.
There are also several smudges coming from the central region, giving it a smeared-out appearance. This may be due to faster gas escaping from the inner regions. The central star (which you can see in the center) is likely a merger of two stars, much like in NGC 6302, and this is driving faster jets of gas. If that jet precesses, as it does in the other nebula, it can create multiple impact points in the gas around it, creating those smudges.
Both these images were taken using Hubble's Wide Field Camera 3, and for the first time employed an array of filters that went from near ultraviolet to near infrared; that has never been done on individual planetary nebulae before. This allows astronomers to see what's happening in different ways; for example being able to isolate the light from iron highlights the precessing jet. That in turn gives insight into the physical processes going on in these objects.
There's a lot we still don't understand about PNe. Some are almost perfectly spherical, meaning the star was probably alone and spinning slowly, while others are highly elongated, like these two. It's also possible that in some, a giant planet orbiting close in to the star was consumed when the star expanded, spinning it up to create bipolar nebulae. Observations like these will help us figure all that out.
Mind you, in, oh, seven or so billion years the Sun will do this as well. When you see objects like these you're looking into our own distant future.
There can be beauty in birth, life, and yes, even death… if your view is big enough.