Neural populations are affected by modulatory influences that fluctuate over time. Direct measurement of these influences is typically difficult or impossible, and one must resort to studying them indirectly, through their effects on individual neuronal responses. Visual attention is one such modulator. In macaque area V4, directed attention increases the firing rates of neurons, but also reduces their variability, as well as the noise correlations between them [Cohen & Maunsell, 2009]. We propose that this assortment of effects arises from a fluctuating, population-level modulation of response gain. We instantiate this hypothesis in a population response model, in which spike counts are drawn from Poisson processes, with instantaneous rates that are the product of a stimulus drive with slowly-varying private, and more rapidly-varying shared modulatory signals. We fit this model to spike trains from populations of ~100 V4 neurons, simultaneously recorded from both hemispheres while the animal performed a stimulus-detection task under directed attention [Cohen & Maunsell, 2009]. The model reveals two separate shared modulatory signals, each operating primarily within one hemisphere. For conditions in which the monkey was cued to attend to one hemifield, the corresponding modulator's mean is larger and its variance smaller. Attention thus increases and stabilizes population gain. These changes in shared modulation, in turn, explain the observed increases in individual neurons' firing rates, and the decreases in their variability and noise correlations. The magnitude of these changes for individual neurons is also predicted by the strength of their coupling to the shared modulators. Finally, the modulatory signals are correlated with the monkey's behavioral performance on each trial, and reflect the reward received on the previous trial. By exposing the detailed, time-varying behavior of internal signals that are coupled with behavioral observables, the model provides a parsimonious explanation for the effects of attention on neural responses.