There are several important differences between comets and asteroids, though the distinction between the two is not absolute. The primary difference is that comets have a tail, whereas asteroids do not. Also important is that comets tend to have extremely elongated orbits, sometimes traveling as far as 50,000 AU (astronomical units, or Earth-Sun distances) or farther away from the Sun, though short-period comets only travel as far as the outer planets before returning to the inner solar system. Asteroids tend to have more circular orbits, and coalesce in belts, like the asteroid belt between Mars and Jupiter or the Kuiper belt beyond the orbit of Neptune.
The tail and coma (atmosphere) of comets is generated by solar heating which vaporizes volatiles (substances with a low boiling point) on a comet's surface, especially ice, and causes it to be ejected all around the comet. Then, the solar wind carries away the vaporized materials, forming the tail. Though one may imagine that the tail extends behind the comet in the direction of its travel, space is a vacuum so there is no wind resistance to cause this to happen. Instead, the tail always points away from the Sun, changing its orientation as the comet orbits the Sun and is swung back into the outer solar system.
Many more asteroids are known than comets. As of 2008, only about 3,572 comets are known, while many millions of asteroids are known to exist. Most comets are believed to originate at locations very distant from the Sun, particularly the Oort cloud, a hypothesized belt of orbiting material located approximately 50,000 AU from the Sun. So, comets consist of those very few objects from the far outer solar system that have orbits that bring them close to the Sun. The very reason that ice exists on them in such large quantities is that they spend most of their time very far from the Sun, where ice is common and the Sun's rays are not intense enough to burn it off.
Conversely, most of the asteroids in the asteroid belt are located within the "snow line" of the solar system, meaning that their surfaces are dry as a bone -- all the ice has long been evaporated away. Most everything within this snow line is dry, with Earth (and ancient Mars) being a major exception. Because Earth is located within the snow line, it is believed that much of its initial water may have been deposited via comet impacts. Further water was produced by chemoautrophic bacteria, which can synthesize water out of hydrogen sulfide and atmospheric carbon dioxide.