Comets are small bodies in the Solar System that orbit the Sun and, at least occasionally, exhibit a coma (or an atmosphere) and/or a tail — both due primarily to the effects of the solar radiation upon the comet's nucleus, which itself is a dwarf planet composed of rock, dust, and ices. They originate in the outer Solar System's Oort cloud, which consists of debris left over from the condensation of the original solar nebula; the outer edges of such nebulae are cool enough that water exists in a solid, rather than a gaseous state. Due to comets's origins and propensity to be highly perturbed by relatively close approaches to the major planets like Uranus and Jupiter, comets' orbits are constantly affected. Some are moved into sungrazing orbits that destroy the comets when they are too near the Sun or when they collide into planets, while others are thrown out of the solar system for eternity.
Asteroids originate via a different process and orbit in the Asteroid belt between Mars and Jupiter, but very old comets which have lost all their volatile materials may eventually resemble or become asteroids.