system
Given the following post, respond as if you're commenting on Reddit:
human
When you look at a really bright object, what actually causes your eyes to experience pain?

I've always wondered this. How does your body know when the photon flux is too high? Does it work like a photodetector in that it measures a bio-photocurrent? And what kind of mechanism reports/interprets this information within the brain?
gpt
Good question. It's called a pupillary light reflex. It's a reflex that controls the size of the pupil to allow a controlled amount of light into the eye so that it can be focused on the retina. In the retina there a number of cell layers each with a specific purpose; one cell layer is the ganglion cell layer which houses the photosensitive ganglion cells that detect light entering the eye an create and electrical impulse. 

These ganglion cells connect to the optic nerve which then connects to the pretectal nucleus of the midbrain bypassing the lateral geniculate nucleus (the part for visual perception) and the primary visual cortex (the part that processes all the information to see things).

From there, the neurons connect to the Edinger-Westphal nucleus which axons go along the oculomotor nerves where parasympathetic nerves connect to the ciliary ganglion. This ganglion has small neurons that innervate the pupillary constrictor muscle to constrict the the iris and control the size of the pupil by making it smaller.

Now what would cause the eye pain in intense light? Well coming from a low light setting into a well lit setting (such as going outside on a sunny day when being inside all day or opening the eyes after a long sleep) the eye needs to adjust according to the intensity of the light. To do this, the pupillary constrictor muscle quickly contracts. This will strain the muscle resulting in a painful sensation or even a spasm until the pupil can adjust.