Edge-wave diffraction theory is used in an unconventional way to predict the field in the immediate vicinity of the aperture plane of a pyramidal microwave horn. The far field may then be inferred by Fourier transformation. The theoretical predictions for the near field are compared with measurements almost in the aperture plane and inside a horn made by the modulated scatterer method. The directivity on axis, which is our primary concern, is mainly determined by the curvature of the wavefront at the aperture. When computed as a function of frequency, it shows oscillations similar to those observed. They arise because edge waves, multiply reflected inside the horn, mimic the effect of a wave reflected back from the throat; this interferes with the main wave to change the curvature of the emerging wavefront, and hence, the directivity.