A main ingredient to a comets core is dry ice. As it gets closer to the sun the ice sublimates into the vacuum of space. Putting dry ice into a shallow pool of water will produce a similar reaction.