I understand that when a comet gets close to the Sun, that water ice from the nucleus goes from the solid state (ice) to a gaseous state (vapor). What happens to it then in the vacuum of space?
Good question. Water vapor in the vacuum of space and when exposed to sunlight further breaks down in a process called photodissociation, into H atoms and OH molecules. The OH molecules fluoresce in the presence of sunlight and is detected with spectrometers sensitive to Ultraviolet light. In fact, we can measure the abundance of water in a comet’s nucleus by measuring the intensity of the emission bands and applying some scaling factors.