a comet is composed of dust and rock particles mixed in with frozen water, methane and ammonia. It circle the Sun in very big elliptical orbit.
Some comets take thousands of years to orbit the Sun. The most popular comet is Halley's comet which takes 76 years to orbit the Sun. When a comet's orbit takes it close to the Sun, the heat from the Sun melts some of the ice. This creates a hazy cloud that looks like a gigantic tail.