We consider the propagation of electromagnetic (EM) waves in the gravitational field of the Sun within the first post-Newtonian approximation of the general theory of relativity. We solve Maxwell's equations for the EM field propagating on the background of a static mass monopole and find an exact closed form solution for the Debye potentials, which, in turn, yield a solution to the problem of diffraction of EM waves in the gravitational field of the Sun. The solution is given in terms of the confluent hypergeometric function and, as such, it is valid for all distances and angles. Using this solution, we develop a wave-theoretical description of the solar gravitational lens (SGL) and derive expressions for the EM field and energy flux in the immediate vicinity of the focal line of the SGL. Aiming at the potential practical applications of the SGL, we study its optical properties and discuss its suitability for direct high-resolution imaging of a distant exoplanet.PACS numbers: 03.30.+p, 04.25.Nx, 06.30.Gv, 95.10.Eg, 95.10.Jk, 95.55.Pe