Cain was the Giants' number three starter in 2009. He threw six shutout innings and had an RBI single against Mike Pelfrey on May 17 in a 2–0 victory over the Mets. In his next start on May 23, he threw a complete game, allowing just one run as San Francisco defeated the Seattle Mariners 5–1. On June 4, in the second game of a doubleheader, he threw a five-inning complete game, allowing one run in a 4–1 victory over the Nationals. He allowed one run in a complete game against Oakland on June 14, striking out nine as the Giants won 7–1. From May 7 through June 14, Cain won seven straight decisions. On July 5, Cain was announced as an All-Star for the first time in his young career. On Cain's final start before the All-Star Game, he was hit by a line drive right below his elbow and was forced to miss pitching for the NL All-Star Team, although he did still attend and was announced as an All-Star. Duke replaced Cain on the NL All-Star team. Cain threw a complete game on August 3 against Houston; however, he suffered the loss for the first time in his career when throwing a complete game, allowing four runs in a 4–3 defeat. On September 25, Cain was awarded the Willie Mac Award.