CHICAGO — Rookie Todd Frazier doubled twice and drove in four runs, Aroldis Chapman came out of the bullpen to stop an eighth-inning rally attempt and the Cincinnati Reds beat the Chicago Cubs 10-8 Friday to end their season-high losing streak at five games.

Ryan Ludwick hit a two-run homer into a 24 mph wind in the third against Justin Germano (1-2) as the NL Central leaders built a 5-1 lead. Ludwick also doubled, walked and matched his career best with four runs.

Homer Bailey (10-7) won for the first time in four starts since July 20, allowing four runs and nine hits in 5 2-3 innings. He set his career high for wins, topping last year's nine.

After Chicago closed to 9-8 with a pair of runs in the eighth, Chapman struck out Anthony Rizzo with a runner on third. Chapman retired the side in order in the ninth for his 26th save in 30 chances and 18th in a row. Paul Maholm pitches 3-hitter,

Atlanta 4, New York 0

NEW YORK — Paul Maholm pitched a three-hitter in his second start for Atlanta and the Braves got two-run homers from Jason Heyward and Dan Uggla to beat the New York Mets 4-0 Friday night.

Heyward connected in the first inning to help spoil Matt Harvey's home debut with the Mets. Uggla went deep in the eighth off reliever Josh Edgin as Atlanta won for the 13th time in 16 games.

The Braves played their first in a stretch of 20 straight games, this one without Chipper Jones. The All-Star third baseman said he was out with back tightness caused by the bed in his New York hotel room.

Los Angeles 5, Miami 2

MIAMI — Hanley Ramirez drove in two runs playing for the first time against the team that traded him last month, and the Los Angeles Dodgers beat the Miami Marlins 5-2 Friday night.

Ramirez, who spent seven seasons with the Marlins before being dealt away July 26, broke a tie in the sixth inning with an RBI single. He added a 40-foot single with the bases loaded in the seventh.

Clayton Kershaw (10-6) allowed two runs in 6 1-3 innings to win his third consecutive start for the Dodgers. Kenley Jansen allowed two baserunners in the ninth but completed a four-hitter to earn his 23rd save in 29 chances.

Juan Rivera hit a two-run homer off Mark Buehrle (9-11), who failed for the fifth time in a row to reach the 10-win milestone for a 12th consecutive season. Buehrle allowed four runs in six innings.

Philadelphia 3, St. Louis 1

PHILADELPHIA — Roy Halladay pitched eight innings and Chase Utley hit a tiebreaking, two-run homer in the eighth to lift the Philadelphia Phillies to a 3-1 victory over the St. Louis Cardinals on Friday night.

It was the second straight outstanding outing for Halladay (6-6), who missed 42 games while on the disabled list with a strained lat. He returned July 17 and struggled in his first three starts back, going 0-1 with a 5.82 ERA. He threw seven innings in a 3-0 victory over Arizona on Saturday.

The right-hander matched a season low by allowing just two hits, while striking out eight and walking none. He didn't allow a hit after Jon Jay's two-out single in the third, retiring 16 of his final 17 batters. The only hitter to reach base was Yadier Molina, who got to first after being hit on the left elbow leading off the fifth.

San Diego 9, Pittsburgh 8

PITTSBURGH —Chase Headley homered from both sides of the plate for the first time in his career and drove in five runs to rally the San Diego Padres to a 9-8 victory over the Pittsburgh Pirates on Friday night.

Headley hit a three-run home run to cap a six-run fifth inning that tied the game 7-7. His two-run blast in the seventh put San Diego ahead 9-8 after Rod Barajas had hit an RBI single for Pittsburgh in the sixth.

San Diego ran its winning streak to 10 games in Pittsburgh and hasn't lost at PNC Park since Sept. 18, 2009. The Padres have won five straight games overall.

Headley's go-ahead home run came off left-hander Tony Watson (5-2), who entered the game with two outs in the seventh inning and walked Everth Cabrera. Headley followed with his 17th homer.

Houston 4, Milwaukee 3

HOUSTON — Brian Bogusevic's RBI single in the ninth inning lifted the Houston Astros to a 4-3 victory over the Milwaukee Brewers on Friday night.

It was the first win this season for Houston in its last at-bat and breaks a five-game losing streak. It was Houston's first walk-off win since last Sept. 26, according to STATS LLC.

The Astros won for the fifth time in 39 games. The only team since 1900 to lose at least 35 times in a 39-game span was the 1916 Philadelphia Athletics, who finished 36-117 under Hall of Fame manager Connie Mack, according to STATS.

Houston trailed 3-2 entering the ninth and the two runs meant the eighth blown save for John Axford (4-7).

Wilton Lopez (4-1) struck out two in a perfect ninth for the win.

The Brewers have lost 10 straight on the road for the first time since 1992.