The electromagnetic field excited by an electric or magnetic line source in the vicinity of an inhomogeneous dielectric layer is considered. The variation in permittivity across the layer is essentially arbitrary. Expressing the fields in the layer in terms of solutions to the Hill equation yields exact integral representations for the fields reflected and transmitted by the layer. These are evaluated approximately using the saddle point technique. Expressions are given for the reflected and transmitted fields and the amplitude of the lateral wave. The characteristic equation for the bound waves is determined. Numerical results are presented to illustrate the behavior of the radiated fields, the lateral wave, and the surface waves as the permittivity profile is varied.