On April 13, pitching the Giants' home opener, Cain threw a complete game shut out, striking out 11. Facing 28 batters in 9 innings, one over the minimum, he allowed a single baserunner on a hit to James McDonald, the pitcher for the Pittsburgh Pirates. It was the third one-hitter of Cain's career. In his next start, on April 18, Cain threw another 9 shutout innings using only 91 pitches, dueling Cliff Lee of the Phillies who threw 102 pitches over 10 scoreless innings. The first 9 innings took only 1 hour and 49 minutes. The Giants went on to win in the 11th inning. Following a dominant first half, Cain was selected to the All-Star Game and was chosen by manager Tony La Russa to be the NL's starting pitcher. On July 10 at Kauffman Stadium, Cain allowed a leadoff single to Derek Jeter before retiring the six remaining hitters he faced; he was the winning pitcher in an 8–0 decision. On July 21, Cain hit his sixth career home run, off of Phillies' pitcher Cole Hamels in the third inning of a 10-inning, 6–5 Giants' victory. Later in that inning Hamels hit his first career home run off of Cain, making this the first time since 2002 when two pitchers have homered off of each other in the same game (Kevin Millwood and Denny Stark were the last to do it).