Boston Red Sox shortstop Stephen Drewtags out Baltimore Orioles’ Manny Machado as he tries to steal second base in the third inning Saturday in Baltimore.

BALTIMORE — Mike Carp and Jonny Gomes homered to back an effective pitching performance by John Lackey, and the Boston Red Sox beat the Orioles 5-4 to end a five-game losing streak in Baltimore.

After dropping the first two games of the series, the Red Sox fell into a 2-0 hole before bouncing back. Carp’s home run snapped an 18-inning scoring drought in the fourth, and Gomes made it 5-2 in the sixth with a solo shot that chased Baltimore starter Freddy Garcia (3-4).

Boston leads Baltimore by 2½ games in the AL East.

Lackey (4-5) gave up two runs, seven hits and a walk in seven innings to improve to 12-4 against the Orioles.

Former Oriole Koji Uehara struck out the side in the eighth and Andrew Bailey gave up a two-run homer to Matt Wieters in the ninth before securing his eighth save.

RAYS 5, ROYALS 3

ST. PETERSBURG, Fla. — Tampa Bay right-hander Alex Cobb was taken off the field on a stretcher after he was hit on the right ear by a liner off the bat of Kansas City’s Eric Hosmer in the fifth inning of the Rays’ 5-3 win over the Royals on Saturday.

The Rays announced that Cobb, who remained conscious the whole time, was taken to Bayfront Medical Center in St. Petersburg for further examination. Rays spokesman Rick Vaughn later said all tests were normal and that Cobb suffered a mild concussion.

Luke Scott, Matt Joyce and Evan Longoria homered for the Rays, who had lost five of six. Alex Torres (2-0) replaced Cobb and struck out four over 1 2-3 scoreless innings. Fernando Rodney pitched the ninth for his 14th save in 19 opportunities.

Joyce hit a solo homer off Jeremy Guthrie (7-4) in the fifth that put the Rays up 4-2.

BLUE JAYS 6,

RANGERS 1

ARLINGTON, Texas — Adam Lind and Colby Rasmus both hit two-run homers and the Blue Jays won their fourth game in a row, beat the sliding Rangers.

Even with the unexpected early return of second baseman Ian Kinsler from his rehabilitation assignment, the Rangers’ season-long losing streak reached five games. All of those losses are at home, and they’ve dropped 10 of 14 overall to fall out of first place in the AL West.

Lind put the Blue Jays ahead to stay in the first, when his seventh homer of the season ricocheted high off pole down the right field line. Rasmus hit his 12th homer, and second in two games, in the fourth to make it 4-0.

Those homers accounted for all four runs off Josh Lindblom (0-2), who went six innings on his 26th birthday.

R.A. Dickey (6-8) gave up one run in 5 2-3 innings.

BRAVES 6, GIANTS 5

ATLANTA — Freddie Freeman’s bases-loaded, line-drive single off closer Sergio Romo capped a two-run rally in the ninth that lifted the Atlanta Braves to a 6-5 win over the San Francisco Giants on Saturday.

B.J. Upton hit two homers off Chad Gaudin, but the Braves trailed 5-4 entering the ninth.

Romo (3-3) walked pinch-hitter Evan Gattis, who was replaced by pinch-runner Reed Johnson, with one out. Andrelton Simmons followed with a grounder that skipped past third baseman Joaquin Arias for an error, putting runners on first and second.

Jason Heyward followed with a liner that fell in front of left fielder Andres Torres, loading the bases.

Justin Upton worked a walk to tie it and Freeman came through with the game-winning single to right field.

Braves closer Craig Kimbrel (2-1) struck out Hunter Pence to end the ninth with runners on first and second.

DODGERS 6, PIRATES 5, 11 INNINGS

PITTSBURGH — Juan Uribe singled home Andre Ethier in the top of the 11th inning to rally Los Angeles to the victory over Pittsburgh.

Ethier doubled off Vin Mazzaro (3-1) leading off the 11th then raced home when Uribe’s chopper went over the head of third baseman Pedro Alvarez. Nick Punto drove in Uribe with a double to the gap one batter later to provide some insurance.

Peter Moylan (1-0) picked up the win after escaping a bases-loaded jam in the 10th. Brandon League, who lost his job as the closer to Kenley Jansen this week, managed the final three outs for his 14th save.

Travis Snider capped a late Pittsburgh rally with a solo home run off Jansen with one out in the ninth to tie the game.

CUBS 5, METS 2

NEW YORK — Scott Feldman allowed two hits in seven innings and Starlin Castro hit a two-run double to left in a three-run eighth inning that lifted Chicago clear of New York.

Feldman (6-5) struck out six and had a two-RBI single in the fourth off Jonathon Niese (3-6) to help himself on the way to his first win since May 29.

Kevin Gregg got the last three outs for his ninth straight save and Chicago beat the Mets for the second day in a row, after losing five of seven before getting to Queens.

BREWERS 6, REDS 0

CINCINNATI — Juan Francisco drove in three runs with a sacrifice fly and homer in a ballpark where he’s had some big moments, and Yovani Gallardo pitched six innings to lead Milwaukee’s blanking of Cincinnati.

It was a rare win in Cincinnati for the Brewers, who have dropped 11 of their last 14 games at Great American Ball Park.

Logan Schafer had three hits off Homer Bailey (4-5), his second straight three-hit game. Schafer is filling in for Ryan Braun, on the DL with an injured thumb.

Gallardo (6-6) gave up three hits and a pair of walks in his second straight impressive start. Three relievers completed a seven-hitter for Milwaukee’s first shutout. The Brewers were the only team in the majors without one.

ROCKIES 10, PHILLIES 5

DENVER — Tyler Chatwood pitched five effective innings in his return from a triceps injury, Tyler Colvin homered during a six-run first inning, and Colorado snapped a three-game losing streak by doubling up Philadelphia.

The Rockies also relied on solid defense to end a six-game skid against the Phillies, turning three double plays and getting a gem from third baseman Nolan Arenado, who snared Jonathan Pettibone’s sharp grounder in the second with a diving stop and made a one-hop throw from his backside to get the Phillies pitcher.

Wilin Rosario had three hits, all for extra bases, Arenado was 3 for 4 with two RBIs, and Chatwood pitched in with two hits, including an RBI single.

Chatwood (4-1) boosted his average to .437 (7 for 16) with 5 RBIs in his first game since June 3, when he left after four innings at Cincinnati because of right triceps soreness.

CARDINALS 13,

MARLINS 7

MIAMI — Carlos Beltran homered from each side of the plate and tripled to lead a 17-hit attack, and Lance Lynn notched his ninth victory when St. Louis outslugged Miami.

Swinging left-handed, Beltran hit his 15th home run in the second inning and tripled for the first time since May 2012 in the eighth. He hit another home run from the right side in the ninth — the 11th time he has homered from both sides in a game.

Yadier Molina singled home two runs in the Cardinals’ five-run first inning, and David Freese’s fourth homer in the third inning put them ahead to stay.

Lynn (9-1) allowed a career-high seven runs in five innings against the lowest-scoring team in the majors, but his two-run single in the fifth inning gave the Cardinals a three-run lead to help them pull away.