The "dirty" snowballs as they are often called, comets are icy bodies that release gas or dust. Comets may contain dust, ice, methane, carbon dioxide, and more. They are made of the materials that made up of space deris, that made planets we know in our solar system today. The solar system is made of huge clouds of gas, and dust, which collapsed 4.6 billion years ago, most the clouds flattened to make planet, but parts that didn't are chunks of gas ,and ice in a place in space where it's cold enough to make the ice. This give the comets the tail.
The most famous comet is Halley's comet, discovered my Edmond Hally, it takes around 75 to 76 to visit the Earth. Its estimated Hally's comet will come back in the year 2061. The comets last arrival was in 1986...
Comet Hale-Bopp was last visible 1997, and won't be visible for ~2,300 years. The comet SL-9 was a line of comets caught by jupiter's gravity, and put on a show during the week July 16, 1994
Picture of Halley's comet