Comets are small, dirty snowballs that were created at the beginning of the formation of our solar system. Observing a comet is like looking at a time capsule from about 4 billion years ago.
Comets are very small objects, ranging from pebble-sized to mountain-sized material. Most exist in the Kuiper belt, a region beyond the planet Pluto, or in the Oort cloud, located even farther away on the distant outskirts of the solar system. These comets are so far out (5 billion to 1,500 billion kilometers) that they travel in a very loose orbit around our Sun. If one of these orbiting snowballs passes another small body, such as another comet or asteroid, its path is hardly changed at all. But if it comes close to a planet, the results are more exciting.
The planet's effect on this tiny body depends on the comet's speed and angle of approach. A planet the size of Earth will most likely cause a small bend in a comet's orbit. More dramatic events result if a tiny comet passes close by a huge planet like Jupiter. (Comet Shoemaker-Levy 9 did just that in July 1994.) The stronger a planet's gravitational attraction, the more a comet's orbit bends. The comet's orbit may be altered so much that it passes close by the planet, and is eventually pulled apart.