PHOENIX (AP) -- Hunter Pence hit a grand slam, Matt Cain dodged trouble for five-plus innings and the San Francisco Giants beat the Arizona Diamondbacks 6-2 on Friday night.
Cain (14-5) walked three in the first and stranded five runners over the first two innings. He failed to make it through six innings for the second time in his last three starts.
The right-hander allowed four hits, walked a season-high five and also hit a batter. He was charged with one run and struck out two.
Buster Posey and reliever Santiago Casilla each drove in a run for the NL West-leading Giants, who won for the third time in four games and are 11-5 in their past 16.
Chris Johnson drove in both runs for the Diamondbacks. Tyler Skaggs (1-2) allowed five runs and five hits in four innings after lasting only three innings in his previous start against San Diego on Sept. 7.
Cain loaded the bases in the first and allowed the first two runners to each in the second but escaped without surrendering a run.