A ruling by third base umpire Bob Davidson cost the Marlins a victory in the ninth. Gaby Sanchez pulled a grounder over third base for a hit that would have scored Hanley Ramirez from second base, but Davidson ruled the ball foul.

Marlins manager Edwin Rodriguez argued in vain, and replays showed ball landed inside the line behind the base.

Ruiz, who had a two-run double in the sixth, broke the tie in the 10th with his fifth homer off Will Ohman (0-1).

Brad Lidge worked the 10th for his 12th save.

The Phillies scored twice in the ninth with no outs to tie the game, but they had three baserunners thrown out in the inning.

Braves 3  Giants 2: At Atlanta, Eric Hinske snapped an 0-for-17 hitless streak with a tiebreaking, sixth-inning home run off San Francisco’s Tim Lincecum .

Alex Gonzalez hit a two-run homer in the second inning — his second as a Brave — for the other runs off Lincecum (11-5).

Jair Jurrjens (4-4) went six innings for the Braves, allowing seven hits, two runs and three walks. Billy Wagner picked up his 26th save with a scoreless ninth.

Lincecum, who had won six of his seven previous starts against Atlanta, gave up six hits and three runs in 6 1-3 innings.

The NL East-leading Braves, who have won three of four, own the best home record in the majors at 37-14.

Pirates 5  Rockies 1: At Pittsburgh, James McDonald pitched six shutout innings in his Pittsburgh debut and Colorado lost its seventh straight road game.

Five days after being acquired from the Los Angeles Dodgers along with a minor leaguer for closer Octavio Dotel , McDonald (1-1) had eight strikeouts — as many as any Pirates starter had all season. He allowed four hits and a walk in his second start of the season and sixth of his career.

Garrett Jones and Ronny Cedeno homered for Pittsburgh, which came in having lost six of its past seven.

Troy Tulowitzki had the lone RBI and three of the Rockies’ seven hits — all singles. Colorado had won five of its past six since snapping an eight-game losing streak.

Jones snapped an 0-for-20 stretch by leading off the second against Jeff Francis (4-4) with his team-leading 15th homer and third in his past three games against the Rockies.

Diamondbacks 8  Nationals 4: At Phoenix, Kelly Johnson and Adam LaRoche both had three hits, and Arizona’s Barry Enright overcame two of Washington’s four solo homers in six solid innings.

The Diamondbacks struck out 12 times to eclipse 1,000 for the season, offsetting that with 13 hits and Justin Upton’s two RBIs to earn a split of the four-game series.

Enright (3-2) gave up solo homers to Adam Kennedy in the third inning and Ryan Zimmerman in the fifth, but little else to earn the win after two tough no-decisions.

Zimmerman added another solo homer off Esmerling Vasquez to follow Roger Bernadina’s the inning before, but the Nationals couldn’t overcome a shaky start from Ross Detwiler (0-2), who allowed seven runs and nine hits in four innings.

Padres 5 Dodgers 0: At Los Angeles, Kevin Correia and four relievers combined on the shutout as San Diego salvaged a split of the four-game series.

Correia (8-7) allowed four hits over 5 2-3 innings and did not strike out a batter in his 100th major league start.

Luke Gregerson gave up two two-out singles in the eighth before Heath Bell got the final four outs for his 31st save.

The Padres lowered their major league-leading ERA to 3.28. Their bullpen leads the majors with a 2.79 mark.

Chad Billingsley (9-6) gave up three runs and seven hits over six innings. He extended his scoreless innings streak to 25 before San Diego grabbed a 3-0 lead in the fourth. Chase Headley and Adrian Gonzalez hit consecutive RBI singles and Tony Gwynn Jr. added a sacrifice fly.