On occasion, particularly when performing an eye exam on a small child the optometrist will direct a light in the eye. But what does this do? Such as test is used to help determine the refractive error of your eye, and it's called retinoscopy. By just looking at the reflection of light off your retina, the eye doctor can assess if you are nearsighted, farsighted or have astigmatism, and can also get a pretty good reading on the prescription you would need to correct your vision.
Essentially, what we are doing during a retinoscopy exam is checking how well your eye focuses. When we use the retinoscope to shine light into your eye, a reddish light reflects off your retina, through your pupil. This is known as the red reflex. The degree at which the light reflects off your retina, also called your focal length, is the thing that tells us how well your eye can focus. If it's apparent that you can't focus well, we hold several lenses with varying prescriptions in front of the eye to see which one fixes the refractive error.
The eye doctor will run your exam in a dark room. The patient will usually be asked to look at something ahead, just behind the doctor. This makes eyes easier to examine. Not having to read any eye charts means that a retinoscopy exam is also a really useful tool to determine the prescriptions of those who may struggle with speech, like young children and the elderly.