David Ortiz became the oldest player ever to hit 30 homers in a season, but the Tampa Bay Rays came back from a three-run deficit to beat Boston 4-3 in 11 innings Wednesday night and prevent the Red Sox from taking sole possession of first place in the AL East.

Luke Maile doubled with two out in the 11th and scored after Red Sox pitcher Heath Hembree (4-1) dropped a throw to first base on Kevin Kiermaier's grounder.

Brad Boxberger (2-0) got the win after one inning of relief.

Boston has won 10 of its last 13 games and remained tied in first with Toronto after the Blue Jays lost 8-2 to the Angels.

Bidding to become the majors' first 18-game winner, Rick Porcello allowed Evan Longoria's tying homer in the eighth before leaving with 7 2/3 innings pitched. It was Longoria's 30th homer.

Red Sox rookie Andrew Benintendi left the game in the seventh with a left knee sprain after being tagged out by shortstop Matt Duffy on a double play.

The 40-year-old Ortiz hit the first pitch he got from starter Matt Andriese in the first inning for a two-run homer. Ortiz is the only player with 30 homers and 100 RBIs in each of the past four seasons, and he's the first Red Sox player to drive in 100 runs 10 times.

Ortiz has 533 home runs, one shy of Jimmie Foxx for 18th on the career list. Ortiz plans to retire at the end of the season.

Porcello pitched seven or more innings in a career-high sixth straight start. His 123 pitches were a career high. The right-hander gave up three runs and nine hits while striking out eight, failing to win for only the second time in 11 starts since June 23.

Mookie Betts drove in Boston's third run with a third-inning single, one of two hits in his 54th multihit game of the season.

Brad Miller's double in the third drove in Tampa Bay's first two runs.

Andriese struck out eight in six innings, giving up three runs on six hits.

ROTATING ROTATION

Boston manager John Farrell said knuckleballer Steven Wright (strained right shoulder) will be reinstated from the 15-day disabled list to start Friday night against Kansas City. LHP Eduardo Rodriguez (left hamstring) will have a bullpen session Thursday, which will help determine where he will be inserted into the rotation. Also to be determined is the role of RHP Clay Buchholz, who was moved out of the bullpen Aug. 13 and made three solid starts. "Once we get through (Thursday) we'll have more clarity," Farrell said.

SIX-MAN ROTATION LIKELY FOR RAYS

With Alex Cobb and/or Chase Whitley coming back from injuries and rookie Blake Snell facing limits on his innings, the Rays are considering a six-man rotation down the stretch, and even that would mean removing a current starter from the mix.

"I think that's probably a good option," manager Kevin Cash said. "We're not going to draw straws and say one guy's out of the rotation, but we're going to have to find a way to get everybody their innings."

TRAINER'S ROOM

Red Sox: 3B Pablo Sandoval, expected to be ready for spring training next year after having left shoulder surgery in May, has resumed working out at third base. ... RHP Carson Smith (Tommy John surgery) will start throwing in 3 1/2 weeks.

Rays: RHP Cobb (Tommy John surgery) will make his final rehab start Saturday for Triple-A Durham and hopes to have his first major league appearance in almost two years during a series Sept. 2-4 against Toronto.

UP NEXT

LHP Drew Pomeranz will make his eighth start for the Red Sox on Wednesday against Rays RHP Jake Odorizzi, who is 5-0 with a 1.64 ERA in six starts since the All-Star break.