It was just the second win this season for Boston, which started the season 1-5 on the road. Friday's game was the first this year in Fenway Park, which is marking its 100th anniversary.
Beckett (1-1) was touched for a second-inning run when Ben Zobrist singled to open the inning and scored on a Jeff Keppinger double. The other Tampa Bay run came in the ninth when Zobrist hit his first home run of the season. That came off reliever Mark Melancon.
The Red Sox scored three times in the third when they sent eight batters to the plate -- all against Rays starter David Price (1-1). The rally included a hit batsman, two walks, two singles, a double, a sacrifice fly and ended with a double play. Adrian Gonzalez, Kevin Youkilis and Davis Ortiz got the runs batted in.
Jacoby Ellsbury doubled in Kelly Shoppach in making the score 4-1 in the fourth.
Boston put the game away with an eight-run eighth. The first 10 Red Sox batters in the inning reached base with Shoppach, Ryan Sweeney and Youkilis contributing two-run hits in the rally.