In fact...the retina only makes(so to speak )light..that is why if you push on your eye(ie rubbing) you will get "stars"...you stimualte your retina with pressue which caused it "become activated" so you saw light
In fact if you apply any excessive stimulation..heat, cold(we use cryotherapy to repair certain retinal tears..I literally apply an iceball through the eyewall..patients always tell me they are seeing stars) etc to the retina you will get light flashes
The pain you feel is related to pain receptors in other layers of the eyewall