We study light propagation through a slab of cold gas using both the standard electrodynamics of polarizable media and massive atom-by-atom simulations of the electrodynamics. The main finding is that the predictions from the two methods may differ qualitatively when the density of the atomic sample ρ and the wave number of resonant light k satisfy ρk −3 1. The reason is that the standard electrodynamics is a mean-field theory, whereas for sufficiently strong light-mediated dipole-dipole interactions the atomic sample becomes strongly correlated. The deviations from mean-field theory appear to scale with the parameter ρk −3 , and we demonstrate noticeable effects already at ρk −3 10 −2 . In dilute gases and in gases with an added inhomogeneous broadening the simulations show shifts of the resonance lines in qualitative agreement with the predicted Lorentz-Lorenz shift and "cooperative Lamb shift," but the quantitative agreement is unsatisfactory. Our interpretation is that the microscopic basis for the local-field corrections in electrodynamics is not fully understood.