Comets, with their long tails, appear like ghostly apparitions that glide across the night sky. In fact, they are more like giant dirty snowballs because most of the time they are just a nucleus of ice and dust a few metres across.
Comet Hale-Bopp showing both its gas (blue) and dust (white) tails. © NASA
As comets get closer, heat from the sun melts the outside layer of a comet into water vapour. Radiation from the sun, known as solar wind , pushes the water vapour, a gas, back into a tail that can be hundreds of kilometres long. Because this tail is caused by the sun's radiation, it always points away from the sun.
As the water vapour is released, dust also comes away. This dust is heavier than the water vapour and the solar winds are not strong enough to push it back. The dust is swept away, following the orbit of the comet as a second tail . It is the dust from comets that causes meteor showers on Earth.
There are potentially trillions of comets. They are thought to come from a giant cloud that surrounds the solar system. This is known as the Oort cloud and it extends one third of the way to the closest star, some 3,750,000,000,000 kilometres (that's 25,000 times bigger than the distance between the Earth and sun). These comets have very long orbits and can take as long as 30 million years to go around the sun. Some comets are captured by the gravity of the large planets Jupiter and Saturn, which keep these comets in shorter orbits of about 20 to 200 years.
Because comets form so far away from the sun and contain ice throughout, they are thought to have never fully melted. This means they should contain elements least changed by the formation of the solar system.