We don't know, at least not exactly. The solar wind contains magnetic fields, and comets produce ionized particles when ultraviolet sunlight photodissociates molecules in the cometary gases. One idea is that because magnetic fields can get 'kinked' in this wind when they impact bodies, these kinks may work themselves out by re-connecting into a new pattern or geometry. This reconnection process liberates energy like solar flares on the sun, and near comets, this energy might be available to accelerate the ions present in the cometary gases. When the ions collide they can give off X-rays.
More study needs to be done to confirm such a scenario.
Return to the Ask the Space Scientist main page.