Magnetophosphenes are flashes of light (phosphenes) that are seen when one is subjected to a changing magnetic field such as when in an MRI.
This changing field causes current within the retina or visual cortex resulting in the illusion of light.
[1] In one series, 8 out of 1023 people having an MRI experienced flashing lights.
[2] Magnetophosphenes have been proposed as an explanation for ball lightning.
This article about magnetic resonance imaging is a stub.