The movement of ribosomes on mRNA is often interrupted by secondary structures that present mechanical barriers and play a central role in translation regulation. We investigate how ribosomes couple their internal conformational changes with the activity of translocation factor EF-G to unwind mRNA secondary structures using high-resolution optical tweezers with single-molecule fluorescence capability. We find that hairpin opening occurs during EF-G-catalyzed translocation and is driven by the forward rotation of the small subunit head. Modulating the magnitude of the hairpin barrier by force shows that ribosomes respond to strong barriers by shifting their operation to an alternative 7-fold-slower kinetic pathway prior to translocation. Shifting into a slow gear results from an allosteric switch in the ribosome that may allow it to exploit thermal fluctuations to overcome mechanical barriers. Finally, we observe that ribosomes occasionally open the hairpin in two successive sub-codon steps, revealing a previously unobserved translocation intermediate.