A theoretical model for the coherency function describing spatial variability of earthquake ground motions is developed. The model consists of three components characterizing three distinct effects of spatial variability, namely, the incoherence effect that arises from scattering of waves in the heterogeneous medium of the ground and their differential superpositioning when arriving from an extended source, the wave-passage effect that arises from difference in the arrival times of waves at different stations, and the site-response effect that arises from difference in the local soil conditions at different stations. Attenuation of waves, which also gives rise to spatial variability, is shown to have little influence on the coherency function. It is shown that the incoherence component of the coherency function is a real-valued, non-negative, decaying function of frequency and interstation distance, whereas the wave-passage and site-response components are complex functions of unit modulus that characterize the phasing of the wave components. A parametric study reveals that the site-response effect can be more significant for short- or medium-span structures situated in regions with rapidly varying local soil conditions, whereas the wave-passage effect can be more significant for long-span, flexible structures.