Comets are lovely. Giant chunks of ice, rock, and dust, they tend to orbit the Sun on long, elliptical paths, and when they get near our star they heat up, releasing gas and dust into space. These form two kinds of tails. One is made of dust, which slowly moves away, each grain on its own orbit, lagging behind the comet on its path as they are slowly pushed by the whisper light pressure of sunlight.
The other is made of gas, formed from ices on or just beneath the comet's surface. This material gets ionized by ultraviolet light from the Sun — electrons are stripped off the molecules. This makes them susceptible to the electrically charged solar wind screaming past them at hundreds of kilometers per second, blowing the ion tail straight back from the Sun.
Many comets sport both kinds of tails. And then there's the comet C/2016 R2 (Pan-STARRS), discovered in Pan-STARRS images on 7 September, 2016. It was remarkable for many reasons, but this image should relay that info nicely.
The comet C/2016 R2 (Pan-STARRS) is an unusual long-period visitor that is almost all ice with an odd composition, so the tail glows blue when excited ...