Comets are made up of collections of ice, dust and rocky particles that are leftover from the formation of the solar system 4.6 billion years ago. Comets range in length from a few kilometers to tens of kilometers. The nuclei are comprised of frozen gases such as carbon dioxide, carbon monoxide, methane and ammonia.
The comet is comprised of three different parts: the nucleus, coma and tail. First, the nucleus consists of a variety of organic compounds forming a crust-covered ball of ice often referred to as a dirty snowball. Due to their low mass, comets become irregular in shape underneath their own gravity.
The coma is formed when the comet's orbit passes close to the sun. As the comet warms up, particles turn from solid to gas. Larger particles are left behind the comet's orbit, leaving a trail. This differentiates comets from stars.
The tail of a comet is comprised of gases that are ionized by the sun's rays, making the comet visible from Earth when it passes through the inner solar system. The tail made up of gases, known as the ion tail, always points away from the sun because the gases are strongly affected by solar winds. The ion tail follows magnetic fields instead of orbital trajectory. The tail of dust left behind the comet is called the antitail.