Spectral Theory of Guided Waves