Why does neuronal activity in sensory brain areas sometimes give rise to perception, and sometimes not? Although neuronal noise is often invoked as the key factor, a portion of this variability could also be due to the history and current state of the brain affecting cortical excitability. Here we directly test this idea by examining whether the phase of prestimulus oscillatory activity is causally linked with modulations of cortical excitability and with visual perception. Transcranial magnetic stimulation (TMS) was applied over human visual cortex to induce illusory perceptions (phosphenes) while electroencephalograms (EEGs) were simultaneously recorded. Subjects reported the presence or absence of an induced phosphene following a single pulse of TMS at perceptual threshold. The phase of ongoing alpha (∼10 Hz) oscillations within 400 ms before the pulse significantly covaried with the perceptual outcome. This effect was observed in occipital regions around the site of TMS, as well as in a distant frontocentral region. In both regions, we found a systematic relationship between prepulse EEG phase and perceptual performance: phosphene probability changed by ∼15% between opposite phases. In summary, we provide direct evidence for a chain of causal relations between the phase of ongoing oscillations, neuronal excitability, and visual perception: ongoing oscillations create periodic "windows of excitability," with sensory perception being more likely to occur at specific phases.