This paper presents an efficient technique to evaluate the Green's functions of single-layer and multilayer structures. Using the generalized pencil of function method, a Green's function in the spectral domain is accurately approximated by a short series of exponentials, which represent images in spatial domain. New compact closed-form spatial-domain Green's functions are found from these images using several semi-infinite integrals of Bessel functions. With the numerical integration of the Sommerfeld integrals avoided, this method has the advantages of speed and simplicity over numerical techniques, and it leads to closed-form expressions for the method-of-moments matrix coefficients. Numerical examples are given and compared with those from numerical integration.