Drew Smyly pitched shutout ball into the seventh inning, and John Jaso's two-run double keyed a three-run eighth to carry Tampa Bay to a 6-2 win over the Boston Red Sox on Wednesday, keeping the Rays out of last place.

Steven Souza Jr. had four hits, Asdrubal Cabrera had three hits and both hit solo homers. The Rays won for the fourth time in 11 games. Tampa Bay lost the opener of the four-game series Monday, falling into the AL East's basement this late in the season for the first time since 2007.

Smyly (4-2) gave up five hits, struck out seven and walked three in 6 1-3 innings.

Mookie Betts had two singles for Boston, which had won 11 of 17. The Red Sox scored both runs with two outs in the ninth.

Brad Boxberger got the final out for his 37th save.

Rick Porcello (8-14) allowed three runs - two earned - on 11 hits, striking out eight and walking one in seven-plus innings.

Making just his 11th start in a season cut short by two stints on the disabled list with left shoulder injuries, Smyly was pulled with runners on first and second. Andrew Bellatti got out of the jam.

Reliever Jean Machi was ejected by home plate umpire Bill Welke after what appeared to be a curveball sailed over Souza Jr.'s head following Cabrera's homer. Souza Jr. then homered over the Green Monster against Roman Mendez.

Tampa Bay moved ahead 1-0 in the seventh. Kevin Kiermaier singled then stole second and third. Daniel Nava, picked up on Aug. 5 after being designated by the Red Sox, then hit a two-out grounder that slipped past second Dustin Pedroia's diving attempt.

Cabrera doubled leading off the eighth and scored on a grounder that third baseman Deven Marrero booted for an error. Jaso had his bases-loaded double against Tommy Layne.

Coming off a rough outing when he was tagged for six runs in six innings against AL East-leading Toronto, Porcello had his third strong start since returning from nearly a month on the disabled list with a strained right triceps.

TRAINER'S ROOM

Rays: Manager Kevin Cash said LHP Jake McGee, recovering from surgery on his left knee in mid-August, could return this weekend after he threw a bullpen session Wednesday.

Red Sox: 3B Pablo Sandoval missed his third straight with an upper respiratory infection.

UP NEXT:

Rays: RHP Erasmo Ramirez (10-6) is set to start the series finale Thursday. Tampa Bay has lost his last five starts.

Red Sox: LHP Wade Miley (11-10) is scheduled to start. He's allowed three or fewer runs in his last three starts.