Boston, MA (SportsNetwork.com) - Evan Longoria hit a pair of solo homers and scored three runs in the Tampa Bay Rays' 5-3 win over the Boston Red Sox on Wednesday.

Joey Butler drove in two runs for the Rays, who took two of three in the series. Alex Colome (2-0) allowed two runs on four hits with four strikeouts over five-plus innings.

Mookie Betts hit a solo homer for the Red Sox, who went 3-6 on a nine-game homestand. Justin Masterson (2-1) gave up four runs on seven hits with six walks over 4 1/3 innings.

"The strike zone really began to elude him," Boston manager John Farrell said. "To regain the strike zone, regain the consistent release point, it was a battle for him."

The Rays took a 1-0 lead in the third when Brandon Guyer doubled and scored on Logan Forsythe's two-out single to left.

Boston responded with two runs in the bottom half. Xander Bogaerts led off with a double and crossed the plate on Blake Swihart's double to left-center field. Swihart moved to third on Betts' groundout and scored on Dustin Pedroia's sacrifice fly.

Longoria led off the fourth with a homer. However, Tampa Bay left the bases loaded later in the frame as Kevin Kiermaier flied out.

The Rays filled the bags again in the fifth. James Loney singled and Longoria and David DeJesus walked. This time around, Butler hit a two-run single to right. Edward Mujica replaced Masterson and got the final two outs of the inning.

"We swung the bats well enough," Rays manager Kevin Cash said. "I know we left a lot of guys on base, but we got some big timely hits when we needed them."

Boston left a runner on third in the fourth and sixth.

Betts got the Red Sox within 4-3 when he homered off Kevin Jepsen in the eighth. Boston went on to load the bases with one out for pinch-hitter Daniel Nava, who hit a grounder to first. Loney went home with the throw for the second out, and Brock Holt grounded out to end the inning.

Longoria homered off Alexi Ogando in the ninth.

Brad Boxberger tossed a scoreless ninth for his seventh save of the season.

Game Notes

Boston outfielder Hanley Ramirez sat out his second straight game with a sprained left shoulder ... It was Longoria's first multi-homer game since Sept. 25, 2013 ... Masterson fell to 2-8 lifetime against the Rays ... The Red Sox went 1-for-12 with runners in scoring position and stranded nine.