SAN FRANCISCO (AP) - Carlos Beltran hit a go-ahead two-run home run among his four hits, Matt Cain calmly recovered from a rough first inning and the San Francisco Giants beat the first-place Diamondbacks 6-2 on Friday night to snap Arizona's season-best nine-game winning streak.
Cody Ross hit a two-run homer and made a nice play with his glove as the reigning World Series champions pulled within five games of Arizona in the NL West race. San Francisco figures it must take the series to stay in the chase for a chance at defending its division title.
Jeff Keppinger added an RBI double off Joe Saunders (9-12) for the Giants, who denied the D-backs brass a trip to the barber shop.
Cain (11-9) won for only the second time in seven starts, escaping a bases-loaded jam in the first with minimal damage.
Whether this crucial victory will help save San Francisco's season remains to be seen.
It is Tim Lincecum (12-11) vs. 17-game winner Ian Kennedy on Saturday night in a marquee pitching matchup. Lincecum has two NL Cy Young awards, Kennedy is vying for this year's honor.
Arizona won't be pulling out those razors this time.
First-year general manager Kevin Towers and team president Derrick Hall vowed to shave their heads if the club's win streak reached 10 - a little friendly bet they had going with manager Kirk Gibson.
The D-backs beat both Cain and Lincecum in consecutive games during their trip here a month ago. That after Arizona dropped three games all by one run at AT&T Park from May 10-12.
This one wasn't close.
Beltran added an RBI single in the fifth and singled again in the seventh to match his career high with four hits. It was his 20th career four-hit game and first since June 30, 2007, at Philadelphia while with the Mets.
The slugger finally produced the way the Giants hoped he would when they acquired him in a July 28 trade from New York, showing the power stroke that has defined his 14-year big league career. The six-time All-Star recently spent a stint on the disabled list with an injured right hand and wrist.
Ross, one of those castoffs and misfits who shined last September and during an improbable championship run, connected in the seventh. Then, he made a spectacular diving catch on Justin Upton's sharply hit fly to start the eighth. Ross caught the ball in fair territory and slid face-first into the dirt in foul territory.
Cain appeared to be in trouble right away but wound up going eight innings, allowing two runs and five hits. After striking out Ryan Roberts to start the game, he allowed Aaron Hill's single, a walk to Upton then Miguel Montero's RBI double. Chris Young drew a free pass one out later to load the bases for Gerardo Parra, but Cain retired him on a fly ball to left.
Santiago Casilla gave up a single to Parra in the ninth before striking out pinch-hitter Geoff Blum to end it.
Keppinger's double off the left-field wall in the third tied the game at 1, then Beltran followed with his 17th home run. Keppinger has eight RBIs in his last nine games.
Beltran hit just his second clout in 21 games since joining the Giants. He came into the game in an 0-for-11 funk and was hitless in his previous three games. He also had been unsuccessful in his last eight at-bats with runners in scoring position and was 2 for his last 20 with chances to drive in runs.
Saunders fell to 0-3 lifetime against the Giants, all the losses this year. He never found a rhythm with a sellout crowd of 40,948 on their feet cheering on a night fog swirled above the outfield in the early innings and wind whipped the ballpark flags right off the bay.
The Giants are the only NL West team Saunders is yet to beat. Hill added a sacrifice fly in the fifth for Arizona's other run.
Pat Burrell was back in the San Francisco lineup and playing left field after he missed 43 games with a strained right foot. He struck out and walked twice before being replaced.
NOTES: These teams meet for three games at Chase Field in the season's final week. ... Beltran tripled in the first. The homer was No. 297 of his career. He is batting .500 (14 for 28) with a homer, three triples, a double and four RBIs in seven games against Arizona this season. ... Lincecum is 0-1 in two starts vs. the D-backs this season despite a 1.20 ERA. He has allowed two earned runs and seven hits with 17 strikeouts and five walks over 15 innings. The loss came here Aug. 2. ... Kennedy beat Cain on Aug. 1 during his stretch of seven straight winning starts. ... The Giants are 45-9 when scoring four or more runs.