BALTIMORE (AP) -- The vast change in the Baltimore Orioles over the past couple of years can be measured by their success against the Boston Red Sox, even when their AL East rivals send Jon Lester to the mound.
Chris Davis hit his major league-leading 23rd home run, Nick Markakis had four hits and scored three runs, and Baltimore beat Lester and the Red Sox 6-3 Sunday.
Manny Machado extended his hitting streak to a career-high 14 games and drove in a run for the Orioles, who took three of four from first-place Boston to move within 1 1/2 games of the division lead. Baltimore has won six straight series over the Red Sox, dating to last year.
Before going 13-5 against Boston in 2012, the Orioles hadn't taken a season series from the Red Sox since 2004. The metamorphosis is even more apparent when gauging their performance against Lester.
Prior to last September, when the Orioles charged into the playoffs for the first time since 1997, Baltimore was 0-14 against the Boston right-hander. They beat him on Sept. 21, and Sunday they tagged him for five runs in five innings.
''Obviously we have a different group here,'' said Davis, who was 0 for 14 lifetime against Lester before ripping a 3-1 pitch in the third inning for a two-run homer that put Baltimore up 3-0.
After striking out in the first inning, Davis took action.
''Went in there and looked at some video just to get an idea of what he'd been doing to me in the past,'' he said. ''I know I hadn't had a lot of success. If you give him both sides of the plate and try to hit all those pitches you make it tough on yourself. I was able to get ahead of him and get a good pitch to drive.''
It was his 100th career homer and seventh in the last 10 games against Boston. Davis also doubled in a run in the fifth against Lester, sending the Orioles on their way to their 14th win in 19 games against the Red Sox, including five of seven this season.
''They don't beat themselves,'' Boston manager John Farrell said. ''Typically they throw strikes, they're not going to issue many walks. They play very sound defense and they have the ability to score a couple of runs on the swing of a bat.''
Will Middlebrooks hit a three-run homer for the Red Sox and Jose Iglesias stretched his hitting streak to 17 games with an eighth-inning single.
Baltimore starter Miguel Gonzalez (5-2) took a two-hitter and a 5-0 lead into the seventh. He ended up allowing three runs and five hits in 6 1-3 innings to improve to 3-0 lifetime against Boston.
''It was fun to watch our hitters hit, especially against Lester,'' Gonzalez said. ''He's been doing a great job this year and always pitched well against us.''
Jim Johnson worked the ninth for his AL-leading 25th save and second in the series.
Lester (6-4) fell to 14-2 lifetime against the Orioles, 7-1 at Camden Yards. The right-hander struck out eight but yielded nine hits.
''They've always been able to swing the bats, there's no question as far as coming in here and pitching against that lineup,'' Lester said. ''They've always been a good offensive team.''
Not this good. The Orioles outscored Boston 17-12 in the series and had 14 hits, seven for extra bases, in the finale.
Baltimore took control with a three-run third. After Adam Jones doubled in a run, Davis hit a drive far over the right-field wall.
In the fifth, Markakis doubled and scored on a single by Machado before Davis hit a two-out RBI double for a 5-0 lead.
Middlebrooks made it interesting with his ninth home run, closing the gap to 5-3 in the seventh. In the bottom half, however, Markakis doubled and scored on a single by J.J. Hardy.
NOTES: Boston's Mike Carp left in the seventh inning with tightness in his right hamstring. ... A crowd of 41,311 pushed the Orioles over the 1 million mark after 35 home dates. ... Machado hit his major league-leading 32nd double, his fifth in five games. ... Actor Richard Gere threw out the ceremonial first pitch. He was wearing an Orioles jersey with the word ''DAD'' on the back. ... Red Sox RHP Pedro Beato pitched the sixth after being recalled from Triple-A Pawtucket earlier in the day. ... Farrell says RHP Clay Buchholz (neck) could go on the DL if he can't throw his bullpen session on Tuesday. Buchholz (9-0, 1.71 ERA) hasn't pitched since June 8. Alfredo Aceves will be recalled from Pawtucket to start in Tuesday's doubleheader against Tampa Bay. ... Jake Arreita will start Monday in Detroit for ailing Jason Hammel, who hopes to pitch Tuesday. ... Lester has yielded six homers in his last three starts after giving up five in his first 12 starts.