When you take a picture using a flash, light travels through the eye and reflects back off the retina and back out through the pupil. Since the shutter of the camera opens and closes so quickly, the captured image is that of the light reflecting back out of the eye. The light is red because the fundus, or interior surface of the eye, contains a brownish-reddish pigment called melanin.
To eliminate “red eyes” in photos the “red eye reduction” setting on most cameras causes a flash to go off once before the picture is taken which causes the pupil to contract and let less light in. You can also position yourself while taking a picture with a flash at a further distance or not directly in front of your subject to reduce the glare.
In ophthalmology, this same phenomenon allows physicians a way to see inside the eye. In the 19th century, a German physician, Hermann von Helmholtz invented the ophthalmoscope, an instrument which allows the examination of the retina by using a bright light near the eye and shining it into the patient’s pupil.