Photic sneezing is a very common problem, surprisingly, that is actually something that can be passed from your parents to you, and then you to your parents. It seems to have something to do with how some of the facial nerves are wired to the nerves of your eyes, and when the sunlight, or any very bright light, stimulates the nerve in your eyes, it triggers the sneeze receptors in your nose that can set of a run of sneezes. Most people can get by just fine by adjusting their routines and being prepared for the inevitable sneezing that follows entering light.
Medications are usually not extremely helpful in addressing the condition, as it is one that is more or less hard-wired into who you are. If your problem is extremely severe, using large brimmed hats and sunglasses might be of benefit to you. If you continue to suffer from this problem, or have any other symptoms, it is always advisable to speak to a physician. An ophthalmologist
would be able to discuss this condition with you in more detail, make sure there is nothing additional going on in your specific situation, and recommend treatments, if any are indicated for you.