BOSTON – Josh Beckett allowed two hits in eight shutout innings and the Boston Red Sox beat the New York Yankees 4-0 on Sunday night to take two out of three games from their rivals after opening the season with six straight losses.

Beckett (1-1) was dropped to fourth in the season-opening rotation but struck out 10 and walked one while retiring the last 14 batters he faced.

The Red Sox returned home after the worst start to a season since they lost their first eight games in 1945. They ended that streak by beating the Yankees 9-6 on Friday before losing 9-4 on Saturday.

Dustin Pedroia reached base all five times he went to bat, with three singles against CC Sabathia (0-1), an intentional walk and a force play. He got on base in 10 of his last 11 trips to the plate in the series as the Red Sox won despite stranding 16 runners, including three in both the sixth and seventh innings

Boston’s starters struggled in seven of the first eight games, but Beckett flashed the form that made him an ace before an injury-plagued 2010 in which he went 6-6 with a 5.78 ERA. Jonathan Papelbon worked a perfect ninth inning in a non-save situation.

Beckett set down the first seven hitters, four on strikeouts, before Eric Chavez singled to center and Russell Martin was hit by a pitch. But Brett Gardner grounded into a double play.

Beckett struck out Derek Jeter to start the fourth, then walked Mark Teixeira, who took second on a single by Robinson Cano, the last Yankee to reach base. The right-hander got out of the inning by striking out Curtis Granderson and retiring Nick Swisher on a ground ball.

The Red Sox took a 1-0 lead in the third on Mike Cameron’s RBI single but kept wasting opportunities as they stranded 12 runners through six innings.

They finally scored again in the seventh on Marco Scutaro’s two-run single. Walks to David Ortiz and J.D. Drew and a single by Jason Varitek loading the bases for Scutaro.

Boston made it 4-0 in the eighth on a leadoff walk to Kevin Youkilis and a long double off the center-field wall by Ortiz.

A baserunning gaffe by Youkilis cost the Red Sox a run in the second. Boston loaded the bases on singles by Pedroia and Gonzalez and a walk to Youkilis. Ortiz grounded to second baseman Cano, who turned a double play as Pedroia scored and Gonzalez took third. But Youkilis was called for interference at second base, sending Pedroia back to third and Gonzalez to second. Cameron then singled home Pedroia before Drew struck out.