ST. PETERSBURG, Fla. (AP) — Rick Porcello stepped off the mound, gathered his thoughts and went back to work.
‘‘I was off a little mechanically. It was kind of tough for me to regain my focus, so I was doing everything I could to slow the game down,’’ the Boston pitcher said after minimizing the damage during a bases-loaded, fourth-inning jam and helping the Red Sox end a three-game losing streak with an 8-2 victory over the Tampa Bay Rays on Tuesday night.
Porcello (9-2) retired the last nine batters he faced after walking Nick Franklin to force in the only run he allowed. The right-hander scattered five hits, walked three and struck out eight over six innings.
‘‘He had his back against the wall in those first four innings, but he did an outstanding job,’’ Red Sox manager John Farrell said. ‘‘Even when he lost a little bit of the strike zone in the fourth inning, he didn’t give in. He didn’t make a mistake that might have cost him multiple runs on base hits.’’
Travis Shaw homered and drove in five runs for the third time this season for Boston, one of just two teams — along with Cleveland — that have yet to have a losing streak of four or more games this year.
‘‘That fourth inning, it was a huge spot to get out of that jam,’’ Shaw said. ‘‘A lot of things haven’t been going right, but I don’t think our confidence or our faith in everybody in this locker room was swayed one bit.’’
Shaw had a solo homer, a two-run double and a two-run single. David Ortiz continued to climb the career RBI list with a third-inning double, and Jackie Bradley Jr. and Hanley Ramirez also drove in runs for Boston.
‘‘We had a very good offensive night,’’ Farrell said. ‘‘Travis Shaw hitting the home run kind of jumpstarted us, and a big night he continued to have.’’
Shaw homered in the second inning. Ortiz’s hit gave the Red Sox a 2-0 lead against Chris Archer (4-11), who’s gone from being an All-Star a year ago to leading the major leagues in losses this season.
One night after moving ahead of Reggie Jackson for sole possession of 24th on the career RBI list, the slugger pulled even with another Hall of Famer, Frank Thomas, for 23rd with 1,704.
‘‘Overall, I felt like I pitched a decent game,’’ Archer said. ‘‘But it was not good enough to get the win, so I’m not very happy with it.’’
Light-hitting Tampa Bay snapped an 11-game losing streak on Monday night, pounding out a season-high 18 hits in a 13-7 win that saddled Boston with its sixth loss in eight games.
The offensive outburst didn’t spill over to Tuesday.
The Rays loaded the bases with no outs in the fourth, but only scored once — with Porcello’s third walk of the inning forcing in the run. The Boston right-hander, who had not walked more than two batters in any of his previous 19 starts, wiggled off the hook by getting Logan Forsythe to fly to right field and fanning Hank Conger and Brad Miller.
‘‘Ultimately, it came down to the fourth inning,’’ Tampa Bay manager Kevin Cash said. ‘‘We didn’t get it done when we had an opportunity.’’
Porcello and reliever Junichi Tazawa didn’t allow another baserunner until Miller’s solo homer trimmed Tampa Bay’s deficit to 6-2 with two outs in the seventh.
Archer, who allowed four runs and seven hits over 6 1/3 innings, fell to 1-8 lifetime against the Red Sox, who’ve won eight straight decisions against the right-hander.
Red Sox: SS Xander Bogaerts, who leads the majors with 109 hits and is batting .343, had a scheduled day off. … C Ryan Hanigan (strained neck) will have his status evaluated after catching a full game Wednesday with Triple-A Pawtucket.
Rays: OF Corey Dickerson (sore left thumb) missed his third straight but was available to pinch hit. … RHP Alex Cobb (Tommy John surgery) is scheduled to throw a batting practice session Thursday.
Rays closer Alex Colome was placed on the 15-day disabled list with right medial biceps tendinitis. The move was retroactive to June 19, so the right-hander is eligible to come off the DL on Monday. ‘‘We’re not too concerned,’’ said manager Kevin Cash, who plans to mix-and-match late in games with Colome sidelined.
Red Sox: LHP David Price (8-4, 4.68 ERA) starts the series finale against his former team. The 2012 AL Cy Young Award winner ranks among the league leaders in strikeouts, innings pitched and wins. He has an AL-leading four outings with double-digit strikeouts, most by a Boston pitcher in a single season since Jon Lester had seven in 2010.
Rays: LHP Matt Moore is 3-4 with a 5.40 ERA in eight career appearances against Boston, including seven starts. He’s 1-2 with a 6.35 ERA in three starts against the Red Sox at Tropicana Field.