The process called outgassing occurs when a comet, an icy, small Solar System body passes close to the Sun and begins to warm and release gases. This produces a visible atmosphere or coma, and sometimes a tail. It is sometimes also called offgassing.

This phenomenon is due to the effects of solar radiation and the solar wind acting upon the nucleus of the comet. The length of the comet nuclei or tail can range from a few hundred meters to tens of kilometers across and are composed of loose collections of ice, dust and small rocky particles.

The length of the visible atmosphere or coma may be up to 15 times Earth’s diameter, while the tail may stretch beyond one astronomical unit. An astronomical unit is a unit of length, roughly the distance from Earth to the Sun and equal to about 150 million kilometers or 93 million miles.

If bright, a comet may be seen from Earth with the aid of a telescope.

More Info: en.m.wikipedia.org