DENVER (AP) -- Michael Cuddyer and Jhoulys Chacin kept rolling and stopped the Colorado Rockies from sliding in the standings.
Cuddyer homered to extend his hitting streak to 25 games, Chacin pitched eight scoreless innings and the Rockies beat the slumping San Francisco Giants 4-1 on Friday night.
Wilin Rosario also went deep and Jordan Pacheco had three hits for the Rockies, who moved within three games of Arizona in the NL West despite having lost eight of 10 entering the day.
Cuddyer's streak is the longest in the majors this season and extended his franchise record. He has reached base safely in 44 straight games, also a club record.
''Cuddy's so locked in right now, I don't know if you can swing the bat any better than he is right now,'' Rockies manager Walt Weiss said. ''He's doing damage, too, when he gets his hits. He's been huge.''
Cuddyer, who signed as a free agent before last season, has helped carry the team through injuries to Troy Tulowitzki and Dexter Fowler. Cuddyer is hitting .381 with six home runs and 18 RBIs during his streak.
''I haven't changed anything, I haven't done anything different,'' he said. ''Balls have just been falling, things have been going my way. I'm not really worried about the streak, it's just pitch to pitch, at-bat to at-bat, evaluate the situation and try to execute. It doesn't matter if you have a hit streak or not, that's your goal every time you step to the plate.''
Cuddyer flied out to left in the first inning before connecting in the third. He worked the count to 2-0 before hitting a 79 mph cut fastball just over the scoreboard in right to give the Rockies a 3-0 lead. Rosario followed with a blast to left to make it 4-0.
''Cuddyer was the big mistake tonight,'' Giants starter Barry Zito said. ''Going low and just throwing a backdoor cutter up in the zone instead of keeping it down. Rosario, he hit a good pitch.''
Chacin (7-3) made it stand up and earned his fourth straight win with another standout performance.
The right-hander has emerged as Colorado's best pitcher in June. He came within an out of a shutout against Philadelphia on June 16 and threw seven scoreless innings in a win over Washington last week. He has thrown 15 straight scoreless innings - one-third shy of his career best - and has allowed just two runs in his last 27 innings.
''I've just been trying to throw strikes. I've been trying to attack the hitter and make them swing,'' Chacin said. ''That's what I've been doing the last three or four starts. Everything has been working out and my fastball has been strong.''
He was sharp again Friday, scattering three hits and walking three to help the Rockies snap a three-game skid. He retired 10 in a row after the Giants had first and second with one out in the fourth, then got Brandon Crawford to ground out with two on to end the seventh inning.
He retired the side in order in the eighth and was hoping to finish the game. But had thrown 95 pitches, close enough to the 100-pitch limit for Rockies starters, so Rex Brothers came on in the ninth.
''I really wanted to go back. I felt good and strong,'' Chacin said. ''After they told me no, that's good for today, let Brothers get the last three outs I said OK. But I really wanted to go back out.''
Buster Posey homered among his three hits for the Giants, who have lost five straight and seven of their last eight.
''I think we need to go out there and relax and get everything clicking together,'' Brandon Belt said.
Zito (4-6) allowed four runs and 10 hits while striking out three in 5 1-3 innings. The veteran left-hander is 0-3 in his last five starts. His last win came against Oakland on May 30 and he is 0-5 in six road starts this season.
The defending champions have struggled to score runs during their slide. San Francisco has managed just 17 runs in its last seven games and just avoided being shut out for the seventh time this season.
''When you're in something like this, it's human nature to start pressing,'' Giants manager Bruce Bochy said. ''Everybody wants to do something to spark the club. Maybe it's better to back off a little bit. We're doing what we can to get this thing going.''
The Rockies took a 1-0 lead in the first on Carlos Gonzalez's RBI double. Two innings later, Pacheco led off with a single and Cuddyer followed with his 14th home run of the season.
Two pitches later, Rosario hits his 13th.
Posey led off the ninth with his 11th home run of the year off Brothers to spoil the shutout. It was the first run Brothers allowed in 32 appearances spanning 30 innings.
The Giants got the tying run to the plate but Crawford grounded out to second to end the game.
NOTES: Posey has reached safely in 46 straight games against Colorado. ... The Rockies hit back-to-back homers for the fourth time this season. ... Fowler (right hand) was a late scratch from the lineup. Fowler has missed the last two games and three of the last four. ... The Rockies activated closer Rafael Betancourt from the 15-day DL and optioned RHP Juan Nicasio to Triple-A Colorado Springs. ... The Giants reinstated LHP Eric Surkamp from the 60-day DL and optioned him to Triple-A Fresno. He will be added to the roster when he reports on Monday, when he will make a start, the team said. ... Giants RHP Santiago Casilla (cyst on his right knee) threw 30 pitches in a simulated game Friday.