The ribosome is an mRNA helicase, actively unwinding encountered structures in the mRNA during translation, so that codons can be read in single-stranded form. Our understanding of the ribosomal helicase has advanced in recent years thanks to a combination of structural and functional approaches. However, the molecular mechanisms of mRNA unwinding by this helicase are still poorly understood. Here, I present the crystal structure of the Escherichia coli 70S ribosome in complex with a hairpin-containing mRNA and A- and P-site tRNAs at 3.9Å resolution. Although the hairpin is disordered in the structure, its presence in the mRNA induces large-scale crystal packing rearrangements. Crystal contacts made by ribosomal protein S3 located near the mRNA tunnel entrance are eliminated, and those made by ribosomal protein L9 are significantly changed. The mRNA itself is relocated from its expected position to allow three nucleotides upstream of the hairpin to interact with protein S3 just outside of the tunnel entrance. In vitro assays on reconstituted ribosomes show that the mutation of S3 residues near the tunnel entrance significantly affect mRNA-dependent tRNA binding, consistent with mRNA binding to protein S3. Based on these observations, a tandem active site model for the ribosomal helicase is proposed, in which the proximal active site is at the tunnel entrance, and the distal active site is three nucleotides further downstream. The single-stranded mRNA between the two active sites binds to protein S3 outside of the tunnel. Translocation over mRNA structures at the distal active site occurs during reverse 30S head rotation, and proceeds via two routes in a stick-slip manner: (1) mRNA unwinding and sliding along the S3 binding interface, or (2) disruption of the S3-mRNA binding without unwinding, allowing bypass to the proximal active site. Unwinding of structures that reach the proximal active site is favored by equilibrium binding of the single-stranded product to protein S3. The kinetic scheme for the tandem active site model accounts for a number of previously unexplained experimental observations, and makes testable quantitative predictions to further study unwinding by the ribosome and other helicases.