The winning streak was the Orioles' longest in a single season since they won 13 straight in 1999.
Ramon Urias homered twice for the Orioles, the first multi-home run game of his career, and Trey Mancini also connected. But Baltimore also left the bases loaded without scoring in the first and fifth innings.
"We just had a bad inning on the mound and we left too many runners on base early in the game," Orioles manager Brandon Hyde said.
The Rays trailed 2-1 in the sixth when they got four straight extra-base hits with two outs.
Bethancourt then launched a pinch-hit home run off the left-field foul pole that was measured at 318 feet, the shortest over-the-fence home run at a major league venue since Houston's Yuli Gurriel hit one 315 feet off Boston's Pesky Pole on June 10, 2021.
"It was kind of a weird one down the line," Hyde said.
Baltimore left fielder Anthony Santander almost caught the ball in the corner, and it took a replay challenge to overturn the original call of foul ball.
"I didn't think it was good enough for a homer, and then I thought he might have knocked it out and I had a double or something," said Bethancourt, who took a delayed trip around the bases.
"I was looking at the ball and looking at [Santander] and I just didn't see it land in fair territory, so I was a little confused when I saw everybody celebrating in our dugout. I was just standing there and I didn't know what to do," he said.
Bethancourt hit four homers for Oakland this season before being traded to the Rays last week.
Mancini and Urias homered early off Rays starter Luis Patino for a 2-0 lead.
Patino was reinstated to the active roster Friday and pitched for the first time since April 11, when he faced three Oakland batters before leaving with a left oblique strain. He gave up two runs on four hits in 3 1/3 innings.
Wells gave up three runs on eight hits in 5 2/3 innings, striking out six.