Well, first, I have to tell you that your eyes may have got the photophobia, which is just a kind of eye disease occurring like your situation. First, you should know that photophobia is eye discomfort in bright light. And in common, it can be ok, and disappear in several hours. But on the other hand, according to some researches, severe photophobia may occur with eye problems and can cause severe eye pain even in relatively low light. For the causes, in common, burns to the eyes or corneal abrasion and even some medicines can also lead to it. Also, eye infection from allergies or bacteria can be possible too. For your situation, if it keeps for a long time, just go and see an eye doctor as soon as possible.
This condition is called floaters and it is harmless. But sometimes it indicates a more serious eye problem. Floaters are caused by detachment of vitreous (a kind of jelly at the back of eyes) from the retina. This process is also called Posterior Vitreous Detachment. The spots you see when you close your eyes are actually the debris of the vitreous jelly. Besides spots, the floaters can appear as flashes, lines, cobwebs etc. No treatment is needed for this condition because that it is a natural aging process or a symptom of migraine. However, you still need to ask an ophthalmologist for advice because sometimes the vitreous pulls the retina away thus causes retinal detachment. The floaters will disappear naturally, so you need not to worry about that.
When people get vitreous opacities which is usually called floaters, they will see many spots in front of their vision. This kind of eye disease can be caused by increasing age, high pressure, high myopia, and so on. People may get very disturbed by the spots they see in their vision which to a great extent affect their normal life and work. You had better go to the doctor's for an examination and get some medicines to treat the floaters. And pay attention to have adequat rest and sleep. Do not be anxious or manic, which will make the condition even worse. Keep in a relaxed mood and a healthy diet. Eat more vegetables and fruits, do not drink or smoke.