Your visual nerves of the eyes may have the problems because of the long time use of eyes in front of the computers or other things. You need to have the good rest for the eyes now. You should better go to see the doctor to find the real reason which could help you treat it as soon as possible. You should not eat the spicy food now which may stimulate your eyes nerves. In a word, you should protect the eyes carefully.
There are many possible causes of flashes of light or photopsia. It can be harmless or extremely dangerous for your eyes. You need to check if you have other symptoms for further recognition of your problem.
Firstly, flashes of light can be a sign of migraine. Flashes appear as sparks, zigzag line, or geometric patterns in the peripheral field of vision.
Secondly, flashes occurs when there is retinal detachment or retinal tear. In this case, emergent medication is necessary, other wise permanent vision loss will happen.
Thirdly, flashes are caused by posterior vitreous detachment as a result of natural aging process. There is no cure for this, but the patient still needs regular examinations.
Well, from your description, I have to say that you may suffer photophobia in some degree. Generally speaking, when you suffer photophobia, your eyes will feel discomfort in the light, and flashes light in your eyes will occur. For the causes, there is some possibility you should take them into consideration. For example, burns to the eyes or corneal abrasion and even some medicines can be common ones. For your situation, I will suggest you go and see the eye doctor.
The flashes of light in your eyes are caused by the traction on the retina from the vitreous jelly which is the major part of the back of the eyeballs and connected to the retina. There are people who are in the same condition as you have spots in the vision that follow the same movement of the eyeballs. Your problem may be vitreous floaters. Actually, the flashes or floating things are small pieces of vitreous jelly. When you move your eyes or rub your eyes, some fibrous bands of the liquefied jelly detach from the back of the eyes and flow. If you are experiencing excessive and continual floaters, drastically vision decline or inability to see light through, you should see your ophthalmologist so as to avoid retinal detachment.