Third baseman Evan Longoria hit a solo home run and an RBI double, leading the Rays to a 4-1 win over the Marlins Thursday at Tropicana Field.
Tampa Bay (78-81) had 16 hits and stranded 11 runners in the first seven innings.
The Rays got a strong start from Jake Odorizzi (9-9), who gave up four hits and one unearned run in seven innings. He struck out seven and walked two.
"It's a good way to end the season," said Odorizzi, who was making his final start of 2015. "It was just 'attack,' and if we give up a hit, oh well, but we were trying to early outs today."
Rays manager Kevin Cash said, "Great way for Odo to finish up his season. He threw the ball really well. ... It was a very solid season. He's probably been as consistent as any starter we've had."
The Rays had nine hits before the Marlins had their first, getting to Miami starter Jose Fernandez (6-1) for 11 hits, the highest single-game total of Fernandez's career. For all that, the right-hander gave up only two runs in six innings.
Tampa Bay added on in the seventh when Longoria hit an RBI double and scored on a single by catcher J.P. Arencibia for a 4-1 lead.
Rays closer Brad Boxberger pitched a perfect ninth for his 41st save, taking over the American League lead from Huston Street.
The Marlins (69-90), who had won five straight before coming to St. Petersburg, lost five of six to the Rays this season. Tampa Bay needs to win its three remaining games against the Toronto Blue Jays to avoid a losing record. The Rays also are working to avoid last place in the American League East, as they are in a three-way tie for the cellar with the Boston Red Sox and the Baltimore Orioles.
It was a difficult homecoming for Fernandez, who graduated from Tampa's Alonso High School in 2011. took his first loss of the season in his final start, having made it back from Tommy John surgery and shoulder problems.
"He gave us a chance -- nine punchouts," Marlins manager Dan Jennings said. "I thought he got better later. His last two innings he really threw the ball well, and it's good to see him finish on a positive note. Peace of mind for the organization, peace of mind for Jose as he goes into the offseason."
Odorizzi didn't allow a hit until the fifth inning, when center fielder Marcell Ozuna singled and eventually scored on a sacrifice fly by right fielder Ichiro Suzuki.
"He spots his fastball extremely well, and he's got that split-changeup that's a very good pitch," Jennings said of Odorizzi. "He made quality pitches all night, kept us off balance."
The Rays jumped ahead 1-0 in the first inning on Longoria's 21st home run of the season, but the next few innings were mostly wasted opportunities.
Tampa Bay made it 2-0 in the third on left fielder Grady Sizemore's RBI single but stranded eight runners in the first five innings.
After five innings, the Rays had 11 hits off Fernandez, whose previous high at that point in 46 career starts was nine.
Odorizzi got a big boost in the seventh inning when center fielder Kevin Kiermaier threw out catcher J.T. Realmuto at the plate to end the inning. Kiermaier picked up his 15th assist, the most of any major league center fielder.
NOTES: It has happened countless times in the World Series, but Thursday marked the first time in baseball history that a National League team and an American League team played a regular-season game in October. ... Marlins 2B Dee Gordon is batting .329, second in the National League behind Washington OF Bryce Harper (.331). Gordon also is second in steals with 56, one behind injured Reds OF Billy Hamilton. If Gordon takes both titles, he would be the first NL player to lead the league in each category since Jackie Robinson in 1949, per the Elias Sports Bureau.