BOSTON – It seemed as though the Boston Red Sox were spraying hits all over the place against Wei-Yin Chen. The problem was, hardly any of them came with runners on base.

Thanks to seven strong innings from Chen and a weak showing by the top of Boston’s lineup Wednesday night, the Red Sox lost 2-1 to the Baltimore Orioles.

Chen scattered seven hits over seven innings and the Orioles set a franchise record with their seventh straight victory in Boston.

“He was throwing a lot of strikes. He just kept pounding the zone with strikes and missing barrels,” said Mike Aviles, who drove in Boston’s run with a sacrifice fly. “I think this is the second time he’s pitched against us and he’s pitched well against us. Just knows how to pitch, a good pitcher all around. Throws all his pitches for strikes and keeps pounding the zone.”

Boston’s first four batters were a combined 1 for 14. The Red Sox stranded eight runners.

Josh Beckett (4-6) was the tough-luck loser, allowing two runs, five hits and striking out five in eight innings. It was the fifth consecutive start he’s pitched at least seven innings.

“Josh pitched awesome,” catcher Jarrod Saltalamacchia said. “The one inning they got their runs, they weren’t really hard-hit. It was just, balls fell in. But in this division, in this league, you’ve got to score more than one, for sure, especially with an offense like that. We’ve just got to do a better job of scoring some runs.”

The Orioles, who knocked Boston out of the postseason on the final night of the regular season last year, have won 12 of the past 15 meetings. They are 5-0 at Fenway Park this season.

Endy Chavez, who had three hits in a series-opening win Tuesday, drove in the go-ahead run with a grounder in the sixth. Boston has lost three straight for the first time since early May.

Chen (5-2) was coming off the worst start of his first major league season, when he allowed five first-inning runs Friday in a loss to Tampa Bay. This time he struck out four, didn’t walk anyone and stranded six runners.

Jim Johnson, who had his first blown save of the season Tuesday after converting 25 straight chances dating to last year, got three outs for his 18th save. The first batter he retired was Saltalamacchia, who hit a tying, two-run homer one night earlier.

Trailing 1-0 and with just a single in the first five innings, the Orioles opened the sixth with three consecutive hits and took the lead with two runs. Robert Andino had an RBI single after Wilson Betemit and Ryan Flaherty singled. Chavez’s fielder’s choice made it 2-1.