Matt Cain pitched eight strong innings and San Francisco beat Tim Hudson for the first time in seven years in the Giants' 8-2 victory over the Atlanta Braves on Friday night.