St. Petersburg, FL (Sports Network) - Jacoby Ellsbury recorded Boston's first hit with a go-ahead two-run homer in the sixth inning, sparking the Red Sox over the free-falling Tampa Bay Rays, 5-2, in the opener of a four-game set.

Ellsbury added an RBI single in Boston's three-run seventh to back a quality start by Aaron Cook (4-10), who won for the first time since Aug. 6 by allowing just one run on five hits over six innings.

Boston has been mathematically eliminated from the playoffs, and the Rays are playing themselves out of contention with six losses in their last seven games.

Coupled with last week's 1-5 road trip against the Yankees and Orioles, Tampa Bay sits 4 1/2 games behind Baltimore for the final AL wild card spot.

Rays starter Alex Cobb (9-9), trying for a sixth straight winning decision, was charged with four runs -- three earned -- on two hits and three walks over six-plus innings.