Spectral theory of electromagnetic scattering by a coated sphere