It's known as a Photic sneeze reflex, and only affects a percentage of people (estimates vary, but it could be anywhere up to 25% ). It seems to run in families, with about a 50% chance of it being passed on to children of an affected parent. This is also far more prevalent among caucasions than any other race.
The most popular theory is that the signals between your optic nerve and your trigeminal nerve (which goes to the nose) get confused and can cross-fire. When you get a increase in light into your eyes, a signal goes from your eye to your brain to let you know it just got bright, then back again to tell your iris to contract to limit the light intake. In some people this will trigger the sneeze reflex due to the crossing of nerve pathways.
There is another theory that says that bright light causes your eyes to water slightly, which then drains to your nose (the tear ducts are connected to your nose via the nasolacrimal duct) causing irritation that leads to a sneeze. This seems less likely though, since the sneeze seems to occur in less time than it would take for this to happen.