Comets are large balls of ice, rock and dust, but you can think of them as large dirty snowballs that hurtle around the solar system.
For most of the time they are invisible, but as they get closer to the Sun, the ice starts to heat up and turn into gas. The water vapour and dust released by this "boiling" process forms an enormous tail that stretches out behind the comet.
In fact, Comets have two tails. The first is the trail of heavy debris (rock and dust) left along the path of the comet, and is known as the dust tail. The second is a stream of lighter material (ionized gas) that is blown away by solar rays and so always points away from the Sun. This is known as the ion tail.
The ion tail is generally the brighter of the two and therefore the only one we see without a good telescope.
In the past, some comets have passed through Earth's orbit and left a trail of dust and rock. When we travel through these trails of past-comets each year we tend to get meteor showers.