A method is proposed for the determination of surface waves produced by a buried source in a half-space. The analytical problem may be divided into two distinct cases, in which the source region is compact or non-compact. For a compact source the angular variation of the outgoing field may be characterized by an analytic function, which we call the 'emission' function. By the use of a representation integral, the surface wave is related to the value of the emission function at a complex angle. The emission function may be approximated by the full-space emission function or its ray-theory representation. As an example of a compact source, a cylindrical cavity with a concentrated line source on its circumference is considered. It is shown that the cavity may have an amplifying effect on surface-wave excitation. Diffraction by a semi-infinite screen is investigated as an example of surface waves generated by a non-compact source. The emission function for the screen, as well as its ray-theory approximation, are not analytic, and the consequent complications are discussed. The general results of this paper provide a means of analysing the excitation of surface waves by combining the intuitively simple aspects of ray theory in real space with a classical integral representation of the wave field.