What is a comet?
A comet is a small body (compared to a planet or star) of few hundred meters up to few kilometres in diameter (Halley's comet has a nucleus of 10 km of diameter) that orbits our Sun with periods ranging from few to million years.
The nucleus of the comet is formed of dust, rocky particles and ice (water ice, and frozen gases such as carbon dioxide, carbon monoxide, methane, and ammonia).
(Introductory Astronomy and Astrophysics - M. Zeilik, S. A. Gregory, E. v. P. Smith)
A comet may pass "near" the Sun during its orbital motion becoming quite bright. This proximity produces changes in the body of the comet, melting its icy surface, vaporizing, ionizing it and producing a kind of atmosphere around the comet (called COMA). The vaporized part of the comet can be also displaced by the solar wind producing the typical TAIL of the comet (it is interesting to note that near the Sun the tail doesn't follow rxactly the comet in its motion but points radially away from it in the direction comet-Sun).