Ethan Siegel of Forbes
Comets are made out of a mix of rocky components, similar to what makes up the Earth's mantle, dust, and ices. Ice doesn't just mean water-ice (H2O), but also volatile components like dry ice (solid CO2), methane (CH4), ammonia (NH3), and carbon monoxide (CO). The full suite of cometary ices was investigated by the Rosetta mission, but these are the big five. Under typical, cold conditions, the ices remain frozen, but as the comet nears the Sun, they start to heat up.
The first thing that happens to a comet, as it approaches the Sun, is that the amount of ultraviolet light striking it becomes great enough that it can start ionizing the weakest molecule there: carbon monoxide. This creates an abundance of the CO+ ion, which streams directly away from the Sun. This turns into a blue ion tail, and is the first comet-like feature to appear as a comet begins to heat up.
As the nucleus of the comet gets hot, more of the ices melt and diffuse away from the surface, creating a large, diffuse set of particles around the nucleus. This diffuse region is known as the coma of a comet, and is made of a mix of gas and dust.
But the coma is more than dust. There is also gas, created from the sublimated compounds that were part of the comet. There aren't merely simple ices and rocks on this body, but more complex molecules made out of these fundamental building blocks: mostly hydrogen, oxygen, carbon, and nitrogen. Two molecules that are of particular interest are cyanide/cyanogen (CN: a carbon-nitrogen bond) and diatomic carbon (C2: a carbon-carbon bond).
When you see that green color, it's an indicator of a combination of things:
that the coma contains large amounts of CN and C2 molecules,
that the comet is active (outgassing) and warm (close to the Sun), and
that the potential for a schism or eruption is at its highest.