Sneezing caused by sunlight or bright light is called photic sneezing. According to a prevailing theory, it happens because of a thick nerve bundle called the trigeminal nerve.
The trigeminal nerve detects or senses irritants in our nose and thus, triggers sneezing to expel them out. The trigeminal nerve lies quite close to the optic nerve which sends visual information from our eyes to the brain. Now, in some people this optic nerve is over sensitive.
When bright light suddenly stimulates the optic nerve, the optic nerve mistakenly transmits some signals to the nearby trigeminal nerve. Hence, the trigeminal nerve misinterprets this signal as an irritant in the nose and thus, triggers sneezing.