BOSTON (AP) — Josh Beckett found a way to beat the New York Yankees this season, over and over again.
The Red Sox right-hander pitched well enough for Boston to win 9-5 on Wednesday night, improving to 4-0 against the Yankees this season with a 1.85 ERA. Last season, his worst in the majors, he was 1-2 with a 10.04 ERA against his team's longtime rivals.
"The Yankee-Red Sox thing has been here before I got here for a long time and it'll be here long after I'm here," Beckett said. "The big thing is we're both really good teams and there's a reason why you've got to play those games a little differently."
Boston is 5-0 in his starts against New York, but he credited his slugging teammates for Wednesday's win. Jacoby Ellsbury hit a tie-breaking two-run homer in the sixth, making it 7-5. David Ortiz and Jason Varitek also had two-run shots.
"I might get the win next to my name," said Beckett (12-5). "I'd say I contributed by eating up some innings, but the guys that probably stuck out all year, they stuck out again today."
He said the difference from last year, when he was 6-6 with a 5.78 ERA, is his ability to execute pitches in key situations.
The Red Sox, who lost the series opener 5-2 on Tuesday night, extended their AL East lead over the Yankees to 1½ games and improved their record to 11-3 this season against them.
"We can't think about what happened up until this point," Derek Jeter said. "If we did, we might as well let them have the rest of the games."
The Yankees had one big inning against Beckett, scoring four runs in the sixth — the same amount they managed in his previous 32 innings against them this season — and went ahead 5-4.
"I wouldn't say we've figured him out," Jeter said. "We were able to score those five runs. It wasn't enough."
In the bottom of the sixth, Phil Hughes (4-5) retired the first batter. Then he went ahead of Josh Reddick 0-2 before walking him, and Reddick scored the tying run on Varitek's double. After Marco Scutaro flied out, left-hander Boone Logan came in to face lefty Ellsbury. On a 3-and-1 count, Ellsbury hit his 24th homer into the left-field seats above the Green Monster.
"I know (Ellsbury) has been tougher on right-handers," Boston manager Terry Francona said, "but he's no day at the beach for left-handers.."
Beckett allowed four earned runs and six hits through seven innings. He struck out eight and walked three.
Daniel Bard and Jonathan Papelbon each pitched a scoreless inning and the Red Sox improved to 62-3 this season when leading after six.
The Yankees had taken a 1-0 lead in the third on Jeter's RBI single. The Red Sox went ahead 2-1 in the bottom of the inning, scoring on Dustin Pedroia's groundout with runners at second and third and on Jed Lowrie's RBI single.
Jeter got his second single in the top of the fifth, moving into 20th place all-time, ahead of Craig Biggio, with 3,061 career hits. He was left stranded.
Boston made it 4-1 in the fifth on Ortiz's homer deep into the center-field bleachers after Adrian Gonzalez singled. It was Ortiz's 28th homer of the year and extended his hitting streak to 14 games.
The Yankees regained the lead in the sixth, helped by an error by right fielder Reddick.
Mark Teixeira was hit by a pitch leading off the inning, took second on a wild pitch by Beckett and scored on a double by Robinson Cano. Nick Swisher then walked and Eric Chavez followed with a liner down the right field line. It got by Reddick and Chavez was credited with a double. The error allowed him to take third and Swisher to score. Eduardo Nunez's sacrifice fly put the Yankees on top 5-4.
Varitek gave the Red Sox a four-run cushion in the eighth with his 10th homer.
But Ellsbury struck the big blow for Boston, against Logan.
"He threw me a couple of pretty good sliders I laid off of," he said. "He threw me a pretty good pitch away. I was able to put a good swing on it."
Besides the 24 homers, Ellsbury, in the last year of his contract, has 36 stolen bases, a .313 batting average, 97 runs and 84 RBIs as the leadoff hitter.
"That's going to be a fun arbitration case, isn't it?" Beckett said.
Notes: Al Nipper in 1987 was the last Red Sox pitcher to go 4-0 against the Yankees. ... New York 3B Alex Rodriguez missed his fourth straight game with a sprained left thumb. ... Red Sox 3B Kevin Youkilis, on the DL since Aug. 18 with a low back strain, played his second straight rehab game for Triple-A Pawtucket and can be activated on Friday. ... Boston RF J.D. Drew missed the second game of his scheduled two-day rehab assignment at Pawtucket on Wednesday night with a sprained middle finger. He was hurt Tuesday night when he went 3 for 3. Plans for the Red Sox to activate him on Thursday may change. He went on the disabled list on July 26, retroactive to July 20, with a shoulder injury. ... Yankees C Russell Martin, with a sore left thumb, missed the game. Manager Joe Girardi said he planned to use him Thursday night in the finale of the three-game series. ... Struggling RHP A.J. Burnett (9-11) faces LHP Jon Lester (14-6) on Thursday night.