4.6 billion years ago, our solar system was just a big cloud of gas and dust. A lot of it gathered together and formed the sun. Most of the rest gathered together and formed planets. Some of the leftover gas and dust gathered into smaller clusters and became things that we know as asteroids and comets.
Comets hang out in the far reaches of the solar system, in either the kuiper belt or the oort cloud. When we try to explain what the comets are made of, we usually describe them as dirty snowballs. “Dirty” because of the dust and rocky particles infused in them. “Snowball” because they’re composed of frozen gases and water ice. This is the comet’s center and is known as the nucleus.
And what of the tails? These appear as the comet comes near the sun. As it enters the inner solar system, the nucleus thaws slightly enough for small pieces of gas and dust to break off. This is what the tail is made of. It behaves somewhat like a cloud, and obscures our view of the nucleus. Now, the reason it trails away from the nucleus and creates that distinctive comet tail is solar radiation. It pushes the gas and dust so that these tails always face away from the sun. That means that when the comet is moving away from the sun, the tail is actually blowing in front of the nucleus!
It might be a hard mental image to grasp, but it makes a little sense if you think about walking around with a scarf on a windy day. The direction the scarf blows in doesn’t depend on which way you’re walking. It depends on the wind! This is similar to what’s happening between solar radiation and the tail of the comet.
Here’s an interesting consequence of the tail: because the comet’s tail always obscures the nucleus, it’s very hard for us to see what the “true comet” looks like if we wait to observe it from Earth. NASA’s Deep Space 1 mission sent a spacecraft into the tail of Comet Borrelly to get a better glimpse of the nucleus. They saw jets shooting out of weak spots and holes in the nucleus. This happens as the gas and dust heats up and expands from within the nucleus. While we recognize and love comets for their tails, these are the amazing views we miss out on.