Tampa Bay, coming off a 1-5 road trip to Baltimore and New York, fell 5½ games behind the AL East-leading Yankees. The Rays also dropped five games back of the Orioles, who won 10-4 in Seattle, for the second AL wild-card spot. “We’re going to have to find a way to bounce out of it,” said Tampa Bay center fielder B.J. Upton, who had three of the team’s six hits.

The Rays have scored just 21 runs over the last seven games.

“This has been ongoing. … This is a seasonal misadventure,” manager Joe Maddon said of his club’s struggling offense. “We’ve been able to remain solvent because our pitching has been so good.”

Tampa Bay leads the AL with a 3.27 ERA. The last five AL teams to finish a season with an ERA as low as the Rays’ current figure all advanced to the World Series.

Rays starting pitcher Alex Cobb and catcher Jose Molina got into a heated discussion in the dugout after the top of the sixth when Boston took a 2-1 advantage. There was a wild pitch and passed ball during the inning.

“We’re both really into that game, and we needed to win that game,” Cobb said. “I honestly don’t really know what the argument was about, still. We’ll work things out. We’ll talk about it tomorrow, or whatever, and leave it behind us.”

Molina declined to comment as he was leaving the clubhouse.

“I’m not unhappy,” Maddon said. “That’s overblown sometimes. That can actually be a good thing. It’s fine right now. We discussed everything. It’s all good.”

Ellsbury hit a two-run homer in the sixth and added an RBI single during a three-run seventh for the Red Sox, who were eliminated from playoff contention Sunday. Cook (4-10) allowed one run and five hits over six innings in his first win since Aug. 6.