BOSTON (AP) -- Mikie Mahtook hit a two-run homer and Matt Moore recovered from a difficult start to strike out seven as the Tampa Bay Rays beat the Boston Red Sox 5-2 on Tuesday night.

Moore (2-4) allowed two hits and walked two in the first inning as Boston took a 2-0 lead.

Boston rookie Henry Owens was perfect through four innings.

More from FoxSports

Logan Forsythe led off the fifth with a double for Tampa Bay's first hit and he scored on a sacrifice fly. Owens (3-3) unraveled in the sixth.

Owens walked Richie Shaffer to start the inning and hit Brandon Guyer with one out. Mahtook singled to load the bases. Evan Longoria hit a sacrifice fly to right and Tampa Bay got another run when Mookie Betts' throw home sailed high and ended up in the stands for a 3-2 lead.

Mahtook added two runs in the eighth with a homer that cleared the Green Monster in left field.

After not allowing a hit through four innings, Owens was tagged for seven before leaving after 7 1-3 innings. He struck out five and allowed five runs, four earned.

Moore allowed seven hits and didn't give up another run after the first inning.

The Red Sox loaded the bases with one out and Travis Shaw drove in two runs with a single, his first of three hits.

TRAINERS ROOM

Rays: RHP Nathan Karns won't make another start this season because of tightness in his forearm, manager Kevin Cash said. Cash said it was a precautionary move and the club didn't want to risk turning something minor into a major injury with the season about to end.

Red Sox: 2B Dustin Pedroia, who had three hits Monday in Boston's 8-7 win, had the night off, manager Torey Lovullo said. ... 3B Pablo Sandoval missed his second straight game with a respiratory infection.

UP NEXT:

Rays: LHP Drew Smyly (3-2) threw a season-high 107 pitches Friday in an 8-6 win over Baltimore. He allowed a season-high five earned runs, but had enough offensive support to get the victory.

Red Sox: RHP Rick Porcello (8-13) will face the Rays for the fourth time this season. He has gone 2-0 against them so far, with 19 strikeouts and only four walks.