BOSTON (AP)Not the way the Tampa Bay Rays wanted to go into the postseason.

Not that it really matters now.

The Rays finished the regular season with a five-game losing streak, giving up a pair of home runs to J.D. Martinez in a 6-3 loss to last-place Boston on Wednesday. Although they entered the final week of the season with a chance to improve their playoff seeding, manager Kevin Cash focusing on resting players for the wild-card round.

”I just told him we can stop sucking now,” he said after a cold and rainy finale at Fenway Park. ”Let’s find ways to win games.”

Xander Bogaerts also had a pair of hits in what could be his final game for the Red Sox. The four-time All-Star, who like Martinez is eligible to become a free agent this offseason, was replaced after taking his position to start the seventh inning, drawing applause from the crowd.

”Those guys mean a lot to us, mean a lot to the community,” said Red Sox manager Alex Cora, who also pinch-hit for Martinez in the eighth. ”They deserved that, to take a moment.”

Despite losing seven of their last eight games, the Rays went 86-76 to finish third in the AL East and will open the best-of-three wild-card round in Cleveland on Friday. Tampa Bay won 100 games last year for its second straight AL East title.

A year after winning 92 games to earn a wild-card berth and reach the ALCS, the Red Sox finished 77-84, 22 games out and in last place in the AL East. The crowd was announced at 26,695 – though fewer than half actually showed up – bringing the team’s total to 2,625,089, its lowest in a non-pandemic season since 2000.

Ji-Man Choi had three hits, including a two-run homer in the third, for Tampa Bay. Vidal Brujan cut the Red Sox lead to 4-3 in the seventh with a solo shot that right fielder Alex Verdugo gloved but dropped into the Boston bullpen when he crashed into the fence.

Eduard Bazardo earned the win in his first career decision, allowing one hit and one walk in a scoreless fifth after starter Nick Pivetta threw 103 pitches in four innings. Josh Fleming (2-5) gave up both Martinez homers, allowing four runs on eighth hits while striking out four.

Christian Arroyo also had two hits for the Red Sox, singling in a run in the two-run eighth to make it 6-3. Matt Barnes pitched the ninth for his eighth save.

BYE-BYE BOGIE?

Martinez is in the last year of a five-year, $95 million contract he signed in 2018, helping the Red Sox win it all in his first season in Boston. Bogaerts signed a six-year, $120 million deal that runs through 2026, but the 30-year-old Aruban can opt out after this season.

”It’s a tough situation for me, because this is all I know. This place has given me so much,” said Bogaerts, who helped Boston win two World Series.

”I’m going home. I’m going to the beach. I’m going to play a lot of dominoes,” he said. ”I don’t want to see a bat and ball. I really do need it.”

Bogarts flirted with an AL batting title but wound up finishing third at .307, behind Luis Arraez (.316) and Aaron Judge (.311).

”Hopefully it’s not the last chapter for the Red Sox and Xander,” Cora said.

ECK’S GOODBYE

Pitcher-turned-broadcaster Dennis Eckersley received a standing ovation from the rain-soaked crowd and both dugouts when he was recognized on the scoreboard in what will be the final game of his 50-year career.

The Hall of Famer, who announced that he will be retiring after this season, was in tears as he left the booth and rode the elevator out for the last time. The video mixed highlights from his 24-year playing career and calls from his time in the NESN TV booth.

”I’m lucky to have had the career I’ve had, and I’m lucky to have been a part of this,” Eckersley said in the pregame show. ”Four championships. Got some rings — I didn’t have anything to do with it. But to be around this, to be a part of it, man, we’re lucky.”

Eckersley, who turned 68 on Monday, was drafted by Cleveland as a California high schooler in 1972 and pitched 24 seasons – winning 20 games as a starter for Boston in 1978 and saving 51 games for Oakland in 1992, when he was the AL MVP and Cy Young winner.

In all, he was 197-171 with a 3.50 ERA for Cleveland, Boston, the Cubs, Oakland and St. Louis. He joined NESN in 2003 and stood out for his outspoken and colorful analysis.

Official scorer Charles Scoggins, a longtime beat writer for the Lowell Sun and Boston BBWAA chapter chairman, also worked his last game. There was cake.

TRAINER’S ROOM

Rays: Placed LHP Colin Poche on the 15-day IL with a right oblique strain and recalled Fleming from the taxi squad.

UP NEXT

Rays: Will face Cleveland in the AL wild-card round, with Game 1 on Friday at 12:07 p.m. ET.

Red Sox: Visit the Atlanta Braves in their spring training Grapefruit League opener on Feb. 25.

More AP MLB: https://apnews.com/hub/mlb and https://twitter.com/AP-Sports