If a comet's orbit brings it close enough to the Sun, heat radiation from the Sun will warm up the comet. As the comet warms up some of the ice vaporises blowing a hole in the tar like surface to produce an active spot, which like a small volcano vents off gas and dust into space. Comets seem to have a number of active spots that vary their activity as the different parts of the comet are heated by the Sun. The vents on a comet produce dust, neutral molecules of hydrogen and other gases and charged ions.
Composite image by NASA's Deep Space 1 spacecraft, taken as
it passed comet Borrelly. The image shows the comet's nucleus, false colour
is used to show the dust jets escaping from the comets surface.