Understanding the relation between prestimulus neural activity and subsequent stimulus processing has become an area of active investigation. Computational modeling, as well as in vitro and in vivo single-unit recordings in animal preparations, have explored mechanisms by which background synaptic activity can influence the responsiveness of cortical neurons to afferent input. How these mechanisms manifest in humans is not well understood. Although numerous EEG/MEG studies have considered the role of prestimulus alpha oscillations in the genesis of visual-evoked potentials, no consensus has emerged, and divergent reports continue to appear. The present work addresses this problem in three stages. First, a theoretical model was developed in which the background synaptic activity and the firing rate of a neural ensemble are related through a sigmoidal function. The derivative of this function, referred to as local gain, has an inverted-U shape and is postulated to be proportional to the trial-by-trial response evoked by a transient stimulus. Second, the theoretical model was extended to noninvasive studies of human visual processing, where the model variables are reinterpreted in terms of ongoing EEG oscillations and event-related potentials. Predictions were derived from the model and tested by recording high-density scalp EEG from healthy volunteers performing a trial-by-trial cued spatial visual attention task. Finally, enhanced stimulus processing by attention was linked to an increase in the overall slope of the sigmoidal function. The commonly observed reduction of alpha magnitude with attention was interpreted as signaling a shift of the underlying neural ensemble toward an optimal excitability state that enables the increase in global gain.