Comets are pretty spectacular occurrences in space and I really hope to see one some day. They are described as dirty snowballs because they are made up of ice of different kinds, but mostly water as well as rock and dust mixed together. They can be a few hundred meters to a few kilometers in diameter and their tails can extend for large distance, even longer than the sun's diameter in some instances. The comet also has a thin atmosphere of it's own called a coma. They generally move in an elliptical orbit which passes around the sun and into the outer solar system, which is why we get see them, but not the same one very often.
As the comet gets closer to the sun, it warms up and sometimes there are jets of gas released from the comet, almost like a geyser, which can make the comet spin. The ice also sublimates as it approaches the sun because of the different gasses that form the ice. Sublimation is like evaporation, except it is when a solid substance turns into a gas directly, not a liquid to a gas. This is part of what forms the coma and the solar winds from the sun are what blow the gasses from the coma away from the sun forming the tail. A comet generally has two tails, the one can easily be seen with the eye because it is made of dust and the second tail can be seen in pictures because it is a tail formed by plasma. From my understanding, plasma is the fourth state of matter, and occurs when a gas is energized a whole lot. This makes the gas into an extremely conductive substance and occurs naturally when lightning strikes.
I would really like to see a comet one day as there was a big one called Hyatake (in the picture above) that could be seen from earth a month before I was born.
Hope you enjoyed the post!