Every active comet has a tail -- that's part of what makes a comet a comet. Where does a comet's tail come from? For most of their lifetimes, comets are ice-cold objects on the fringes of the solar system, and lack tails. They are space rocks primarily made up of ice and dust -- when a comet is active, this rock is called the nucleus. As the comet orbits the Sun, it eventually passes into the inner solar system, where the solar wind and sunlight becomes intense enough to start vaporizing some of the comet's ice and dust, which subsequently ionizes and becomes the long, stretched-out comet tail.
A comet tail can become extremely long -- one astronomical unit (Earth-Sun distance, 150 million km or 93 million mi) -- the coma, or immediate atmosphere around the comet, can be larger than the Sun. All this from a nucleus anywhere between 100 meters (328 ft) and 50 km (31 mi) across, with a 10 km (6 mi) diameter being typical for comets visible to the naked eye. Because comets only spend a small minority of their time in the inner solar system, they have a lot of ice and other volatiles to release when heated by the Sun.
The reasons why a comet tail is so luminous despite its low density are complex. When solar ultraviolet rays impact the dust around the nucleus, the photoelectric effect causes these particles to release electrons for each ultraviolet ray that excites them. These electrons produce an "induced magnetosphere" around the nucleus, which blocks the outwardly flowing solar wind particles. Because comets move at supersonic speeds relative to the solar wind, a bow shock is formed at the front of the comet, similar to the bow shock formed around a moving ship at sea. Cometary ions congregate in this area, "loading" the solar magnetic field with plasma. The luminous plasma flows backward from the direction of the Sun, coalescing in between the drawn out magnetic field lines generated by comet's induced magnetosphere.
So, the luminosity in a comet tail comes mostly from the luminosity of condensed ions, not the dust reflecting the light of the Sun, though the latter contributes a little. Because the comet tail is not generated solely by the material presence of dust particles behind the comet, it can be eliminated if the magnetic field is broken, which can occur during magnetic reconnection. This event, which can be triggered by a coronal mass ejection from the Sun, has been observed on several occasions, most recently in comet Encke in 2007, and is called a tail disconnection event."