We present a theoretical foundation for the beaming of light displayed by a single subwavelength aperture in an appropriately corrugated metal film [H. J. Lezec, Science 297, 820 (2002)]]. Good agreement is found between calculations and experimental data. We show that beaming is due to the formation of electromagnetic surface resonances and that the beam direction, width, and wavelength at which it occurs can be selected by tuning geometrical parameters of the structure.