BOSTON (AP) -- Asdrubal Cabrera had a game-tying RBI double and scored on James Loney's single in the eighth inning, and the Tampa Bay Rays avoided a three-game sweep with a 4-3 comeback victory over the Boston Red Sox on Sunday.
Brandon Guyer opened the game with a homer for the Rays, who had lost 13 of their last 16 road games.
David Ortiz had an RBI for Boston, passing Hall of Famer Andre Dawson for 37th place with his 1,592nd RBI.
The Red Sox were looking for their first sweep of a series of three or more games since early June.
Steve Geltz (2-4) got the victory, retiring the only batter he faced. Brad Boxberger, the fourth reliever, struck out the final three batters for his 26th save.
The Red Sox wasted a solid start by Wade Miley, who held the Rays to two runs over 6 2-3 innings.
Trailing 3-2, Evan Longoria opened the eighth with a double off the Green Monster against Junichi Tazawa (2-4). One out later, Cabrera hit his ground-rule double over the head of right fielder Rusney Castillo. Loney followed with a bloop hit to center.
Miley gave up five hits, striking out four and walking one in his season-high 120-pitch effort before being lifted after Kevin Kiermaier's two-out triple in the seventh.
Robbie Ross Jr. relieved and hit the first batter, walked the second, but struck out Joey Butler swinging on an inside cutter.
Jake Odorizzi, making his fifth start since a month on the disabled list with a strained left oblique, gave up three runs in six innings.
The Red Sox scored twice in the first to move ahead 2-1. Hanley Ramirez had an RBI double and scored on Mike Napoli's single.
They made it 3-1 on Ortiz's RBI double after Xander Bogaerts was hit by a pitch.
Tampa Bay sliced it to one on Loney's two-out RBI double into the right-field corner.
Guyer homered on the fifth pitch, hitting a shot that caromed off a billboard above the Monster seats.
Rays: Placed OF Steven Souza Jr. on the 15-day DL after he broke his left hand getting hit by a fastball from Joe Kelly on Saturday. Manager Kevin Cash said he's expected to miss 4 to 6 weeks.
Red Sox: Placed struggling RHP Rick Porcello on the 15-day DL with soreness in his right triceps. ... 3B Pablo Sandoval was out for the third straight game because of a bruised left forearm after getting hit with a pitch Thursday before striking out pinch-hitting in the ninth. ... Manager John Farrell said OF Mookie Betts, on the seven-day concussion DL, is not expected to travel to New York for the club's upcoming series against the Yankees.
Ramirez's bat flew into the stands about 20 rows behind the Rays' on-deck circle, but no one was injured. He had a security guard give another bat to a fan after getting back the one he was using.
Rays: RHP Nathan Karns (6-5) was flip-flopped with Odorizzi and is scheduled to open the three-game series against LHP Jose Quintana (6-9) when they play at the Chicago White Sox on Monday. He's made 15 starts giving up two or fewer runs, which entered Sunday tied for the AL's most.
Red Sox: Off Monday. They have not named a started for Tuesday's series opener against Masahiro Tanaka (7-4) at Yankee Stadium. Farrell did say it would be "someone not on the current roster," which hints of a call up.