We present a model for flicker phosphenes, the spontaneous appearance of geometric patterns in the visual field when a subject is exposed to diffuse flickering light. We suggest that the phenomenon results from interaction of cortical lateral inhibition with resonant periodic stimuli. We find that the best temporal frequency for eliciting phosphenes is a multiple of intrinsic (damped) oscillatory rhythms in the cortex. We show how both the quantitative and qualitative aspects of the patterns change with frequency of stimulation and provide an explanation for these differences. We use Floquet theory combined with the theory of pattern formation to derive the parameter regimes where the phosphenes occur. We use symmetric bifurcation theory to show why low frequency flicker should produce hexagonal patterns while high frequency produces pinwheels, targets, and spirals.