The retina knows no pain, but if there is some pulling on it, it may give the sensation of flashing lights. It warrants a checkup sooner rather than later. If it is accompanied by a "curtain" across your vision, it warrants an IMMEDIATE emergency check up. Lookup retinal detachment and PVD (posterious vitreous detachment).
There are flashes from a retinal origin and also from the brain. You should see an ophthalmologist.
Dr. O.