Comets start out as a dark object traveling through deep cold space. This shows how they grow a tail as they enter the warmer regions of space. A comets tail can stretch for many thousands of miles.

If you would like to read along, here is the text!

Comets are believed to have a solid core, and accumulate additional dust and ices on its surface as they travel deep into the Oort Cloud. As the comets elliptical orbit brings it back closer to the Sun, it approaches the distance of the asteroid belt, outside the orbit of Mars, where its ices begin to turn to gas, releasing hydrogen, carbon, oxygen, nitrogen, and other substances in the form of vapors and dust particles. They are carried away from the comet by the Solar wind, forming a tail. On its return path it cools and the tail goes away until the next trip.