Natural boundaries and spectral theory