Comets are small, fragile and irregular shaped masses made from a mixture of space dust and frozen gases. So far we have found them all to possess elliptical orbits that bring them very close to the Sun and swing them back into deep space, going even beyond the orbit of Pluto. For those that don't know, that's really far.
A comet's structure is diverse in shape and movement, not to mention very dynamic. They develop a surrounding cloud of various material, called a coma. That usually grows in size and brightness as the comet approaches the Sun. This prevents us from finding the true shape of the comet's heart unless special equipment is used. Comet's also contain a small, bright nucleus (less than 10 km in diameter) in the middle of the coma. The coma and the nucleus together constitute the head of a comet.
As comets approach the Sun they develop marvouels tails of luminous material that extend for millions of miles from the head, away from the Sun. The direction of a comet's tail is always away from the sun, so when the comet starts moving away from earth it appears to be chasing it's tail. It is the solar wind that makes this effect possible.
When far from the Sun, the nucleus is very cold and its material is frozen solid, which also means there is a less pronounced coma. In this state comets are sometimes referred to as a "dirty snowball" since over half of their material is ice. When a comet approaches the Sun, the surface of the nucleus begins to warm, and the ice and other frozen gasses begin to evaporate. The steam boils off and takes little particles of dust with it, forming the comet's coma of gas and it's great tail.
This crappy diagram shows you the comet Hale-Bopp's head, ion tail, hydrogen evelope, coma, nucleus, and dust tail. You can see the larger untouched image here.
The comet absorbs ultraviolet light as it gets closer to the Sun, chemical processes release hydrogen, which escapes the comet's gravity, and forms a hydrogen envelope. This envelope cannot be seen from Earth because its light is absorbed by our atmosphere, but it has been detected by spacecraft. I don't know which ones but that's what NASA says.
As the Sun melts a comet's head, differant particles go in differant places. In space everything has it's own relative gravity. The Solar wind can't force lighter objects like dust particles and certain gas vapors as fast as it can heavier things like the unmelted ice particals. So each go to a differant tail called the "dust tail." It forms away from the coma.
The ion tail is much less massive, and is accelerated so greatly that it appears as a nearly straight line extending away from the comet opposite to the Sun.
A comet's distace is stated in in something called an AU (Astronomical Units) for space messurement. I don't know how many miles that is, but it's bigger than anything we use for earth.
Here are some neat space comet links!
NASA's Potential Impact Site - NASA's page on the potential impact of a comet or meteor with the earth. Ever wonder what Snow Kaguya's comet would have done if it had crashed?
Halebopp.com - A site about the hale-bopp comet that passed by not so long ago.
Shoemaker-Levy 9 / Jupiter Impact - this is info on the comet that broke apart and hit jupiter in 1994.