Alex Cobb opened with six one-hit innings, Evan Longoria hit a two-run homer and the Tampa Bay Rays beat the Boston Red Sox 5-4 on Friday night at Fenway Park.