It sounds like some of the gel-like substance inside your eye may have separated from the inside wall of you eye. It happens to most people to a varying extents as they age, and when it happens over the retina it causes flashes of light. The flashes are more noticeable at night, especially when you turn your head a certain direction. It can be a distracting nuisance, but given time, the brain learns to ignore it in most people. Although the vast majority of the time, it is harmless, on occasion some of the retina may detach with it, which is very serious. You should see an ophthalmologist about it soon to be sure.