Scattering of Lyα Photons through the Reionizing Intergalactic Medium: I. Spectral Energy Distribution