Ben Zobrist hit his 20th homer and Chris Giminez had a two-run double off Wei-Yin Chen as the Rays pulled away from a 1-1 tie. Cobb (11-9) yielded a fourth-inning single to J.J. Hardy and an opposite-field solo homer to Matt Wieters that had tied it in the top of the seventh.
The Rays won for the 11th time in 12 games, a stretch that's kept them in contention for the AL's second wild-card.
They began the night trailing Oakland by three games and must sweep the Orioles and hope the A's drop three straight to Texas to remain alive.
Baltimore already is assured of being in the playoffs for the first time in 15 years, but still has its sights on outlasting the Yankees for the AL East title. The Orioles fell a game out of first place behind New York.