SAN FRANCISCO -- 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.