What can cause a quick brief flash of light in my eye when closing my eyes to go to sleep?

I noticed this for about a day or two now. I ll close my eyes and after a few minutes I notice a quick flash of light in one of my eyes. It has me a little worried. No sound accompied by it. It happen again like 2-3 times last night. It freaked me out so each time I opened my eye then eventually I fell to sleep. I know it can be a lot of things, but wonder if anyone else has experience this. It happened maybe 2-3 or 5 in the morning. I sleep with my room pitch black and don t notice it when awake and alert during the day. Only when trying to sleep.
Answers

Ham

First off I highly recommend seeing some sort of medical professional. Now, did some event happen recently or right before you started getting these and is it only in one eye. I'm not a medical professional sorry but I'd be happy to hear whatever you'd like to tell me.