Most comets originate from the deep dark depths of the solar system, far, far away in the Oort Cloud, a loose collection of frozen cosmic debris that surrounds our solar system like a spherical shell. Most of the debris in this shell is left over from the formation of the solar system, five billion years ago, but some may have come from interstellar space, captured by the Sun's gravitational pull. Since they are so far away from the heat of the Sun, comets are composed largely of frozen gases, mixed with dust and dirt. When their far ranging, highly eccentric orbits bring them close to the Sun, these frozen gases begin to vapourize, giving rise to the comet's distinctive tail.
Comets actually have two tails. The lighter gases form a long tail that always points directly away from the Sun. This is called the gas tail, or ion tail, and is usually visible only in time exposure photographs. The heavier gases and dust particles usually flow more in the comet's direction of travel, although the added influence of the solar wind may cause this tail to curve. This tail is usually much shorter, and called the dust tail. This is the tail normally visible to the naked eye. In the photo above, the two distinct tails are clearly visible, with the blue ion tail pointing straight out away from the Sun, and the bright dust tail curving off to the right.
At any one time, there are usually at least a half dozen comets in the night sky that are visible with a backyard telescope, and many more that are only visible through very large telescopes. Comets that are visible with the naked eye are rare, and may show up once or twice a year. The kinds of comets that produce spectacular tails visible to the naked eye are even more rare, occurring once every few years. When they do occur, however, they are unforgettable, so it's a good idea to keep an eye out for them. To find out what kinds of comets are up in the sky right now, and where to find them, visit http://cometchasing.skyhound.com/.