We consider the optical properties of the solar gravitational lens (SGL) treating the Sun as a massive compact body. Using our previously developed wave-optical treatment of the SGL, we convolve it with a thin-lens representing an optical telescope, and estimate the power spectral density and associated photon flux at individual pixel locations on the image sensor at the focal plane of the telescope. We also consider the solar corona, which is the dominant noise source when imaging faint objects with the SGL. We evaluate the signal-to-noise ratio at individual pixels as a function of wavelength. To block out the solar light, we contrast the use of a conventional internal coronagraph with a Lyot-stop to an external occulter (i.e., starshade). An external occulter, not being a subject to the diffraction limit of the observing telescope, makes it possible to use small telescopes (e.g., $\sim 40$~cm) for spatially and spectrally resolved imaging with the SGL in a broad range of wavelengths from optical to mid-infrared (IR) and without the substantial loss of optical throughput that is characteristic to internal devices. Mid-IR observations are especially interesting as planets are self-luminous at these wavelengths, producing a strong signal, while there is significantly less noise from the solar corona. This part of the spectrum contains numerous features of interest for exobiology and biosignature detection. We develop tools that may be used to estimate instrument requirements and devise optimal observing strategies to use the SGL for high-resolution, spectrally resolved imaging, ultimately improving our ability to confirm and study the presence of life on a distant world.