The theory of secondary resonances in the spin-orbit problem