On the corona theorem and its application to spectral problems in Hilbert space