ST. PETERSBURG, Fla. — Xander Bogaerts kept getting on base – for six hours.

It paid off in the 15th inning Friday night when the Boston shortstop contributed two hits in a seven-run inning that lifted the Red Sox to a 13-6 win over the Tampa Bay Rays.

“The more you get on base, the more there’s a possibility of you scoring, so just creating the opportunity is huge,” said Bogaerts, who was hit by a pitch in the first inning and reached base five straight times from the ninth inning on.

By winning the 6-hour, 5-minute game, the Red Sox maintained their three-game lead over the New York Yankees in the AL East. It was their 13th win in 16 extra-inning games this season.

“We can say that we’ve been there. To play those long games, you become accustomed to it physically,” said Jackie Bradley Jr., who had two of Boston’s 21 hits. “It stinks, but we know that we can still battle back and get the job done.”

Austin Pruitt (7-5) walked Bradley to lead off the 15th. Bogaerts followed with a single, and Dustin Pedroia hit a ground ball that was misplayed by second baseman Brad Miller, allowing Bradley to score the lead run. Andrew Benintendi, Mitch Moreland, Deven Marrero and Bogaerts drove in extra runs for the Red Sox, who have won seven of nine.

Brandon Workman (1-1) got the win. Blaine Boyer, the 21st pitcher to appear in the game, pitched the 15th for Boston.

Nine Red Sox pitchers set a club record with 24 strikeouts.

Boston rallied for three runs in the ninth off closer Alex Colome to tie the game, a rally cut short by Kevin Kiermaier’s diving catch of a line drive hit by Bradley with two men on. Kiermaier also leaped in front of the center-field wall to take an extra-base hit away from Betts leading off the 10th, and homered in the 14th to tie the game 6-6.

Colome blew a save for the first time since July 27.

“Anytime you’re up 5-2 going into the ninth you feel pretty good,” said Rays manager Kevin Cash. “(Colome) couldn’t find it. He couldn’t find the cutter. He kept trying to go to it but it wasn’t there for him.”

Wilson Ramos hit two home runs for the Rays, including a two-run shot off Chris Sale in the fourth. He added an opposite-field homer, his ninth of the season, off reliever Matt Barnes in the eighth to make it 5-2.

Adeiny Hechavarria also homered off Sale, his seventh of the season.

Sale gave up four runs, six hits and three walks while striking out nine in 5 2/3 innings.

“My fastball command was off and I made some mistakes with home runs, but it’s going to happen,” said Sale, who is 3-3 since the beginning of August after starting the season 13-4. “It’s nice being able to sit here now after the fact, but winning this game boosts the morale. It makes me not go home and stare at the ceiling.”

It was the first game at Tropicana Field since Hurricane Irma stormed through the Tampa Bay area late Sunday night. A three-game series scheduled earlier this week against the Yankees was moved to Citi Field in New York.

CASE CLOSED?

Dave Dombrowski, president of baseball operations for the Red Sox, said the fine levied on the club Friday for using electronic equipment to steal signs was “pretty much what we had thought,” and said he hoped the matter was closed. “There won’t be any internal fines,” Dombrowski said. “The topic’s been discussed internally and addressed, and I’m sure it will not happen again.”

TRAINER’S ROOM

Red Sox: DH Hanley Ramirez missed a second straight game, and an MRI revealed “some signs of inflammation in the bicep area,” according to manager John Farrell. … INF Eduardo Nunez is showing encouraging signs while recovering from a knee injury and might return to the lineup during the current road trip.

Rays: RHP Jake Faria was activated after missing 25 games with a left abdominal strain. The rookie, who has started 13 games, will be in the bullpen until further notice.

UP NEXT

RHP Rick Porcello, who was 5-0 against the Rays on his way to winning the AL Cy Young Award last season, is 1-4 against them going into Saturday night’s start.

RHP Alex Cobb, who won at Boston on Sunday, will pitch for Tampa Bay.