Comets are small bodies which formed early in the evolution of the Solar System, far from the Sun. They are comprised of a mixture of stony materials and ices. Billions of them orbit beyond the orbit of Neptune. Occasionally these are perturbed and directed into the inner Solar System. Some are further perturbed by Jupiter and end up in periodic orbits of a few years to a few decades; some are one-time visitors, some will return, but not for many thousands of years.
When comets get near to the Sun- typically somewhere between the orbit of Mars and Jupiter- they heat up enough that their ices are released as gas. The expelled gas usually carries dust and pebbles along with it. This produces the comet's characteristic tail (or tails- the dust and gas are usually pushed in somewhat different directions.
Most comets never get bright enough to be seen except with some kind of optical aid- a telescope, binoculars, or long exposure camera. Every few years one becomes bright enough to see with the naked eye, and a few times a century a comet may appear that is truly spectactular- perhaps even visible in daylight. Such comets are largely unpredictable, and are often discovered only a few months before they reach their peak.
Click on images to learn more.