Updated

The Rays are within a game of the AL wild card lead.

Tampa Bay scored all of its runs on homers Sunday afternoon, rolling to a 5-2 victory over the Toronto Blue Jays in the finale of a three-game series.

"Mission accomplished," said Rays manager Joe Maddon.

Indeed, his team did its part. And because the Red Sox split a doubleheader in New York, the Rays cut Boston's lead to a game in the AL wild card race. It was a half-game, but the Red Sox won the nightcap, 7-4, thanks to Jacoby Ellsbury's three-run homer in the 14th inning.

Evan Longoria hit a two-run homer while B.J. Upton, Ben Zobrist and Kelly Shoppach added solo blasts for the Rays, who have won two of three in the series and three of their last four overall.

"The guys were definitely ready to play today," said Maddon. "Not that they're not on a nightly basis, but you could see it in the dugout and you could feel it in the dugout."

Tampa Bay remains at home to finish the season with three games against the AL East champion Yankees starting Monday. The Red Sox play in Baltimore.

"Tomorrow is now the biggest game of the year, just like today was," Maddon said.

Wade Davis (11-10) pitched eight innings to earn the win Sunday, giving up two runs on three hits and two walks. He struck out six and snapped a two-game personal losing streak.

Joel Peralta threw a perfect ninth for his sixth save.

Dewayne Wise homered and David Cooper hit an RBI double for the Blue Jays, who have dropped four of their last six and end the season with three games in Chicago against the White Sox beginning Monday.

Toronto slugger Jose Bautista was replaced for a pinch hitter in the sixth inning. Bautista bruised his knee running into the right field wall on Zobrist's inside-the-park homer in the first inning.

Brett Cecil (4-11) allowed three of Tampa's four homers and went winless (0-7) over his last 10 starts of the season after giving up four runs, five hits and two walks.

Cecil earned his last win of the season on July 29.

Game Notes

Tampa Bay never trailed after Upton and Zobrist's home runs in the first inning...The Blue Jays were 0-for-3 with runners in scoring position and left three men on base. The Rays went 0-for-2 and stranded seven.