Cain was drafted by the San Francisco Giants in the first round of the 2002 Major League Baseball draft out of high school. He advanced quickly through the minor leagues and made his debut with the Giants in 2005, becoming the youngest player in the National League (NL) that year. In 2006 (his first full season), Cain won 13 games and finished tied for fifth in NL Rookie of the Year voting. Cain had the 10th-best earned run average (ERA) in the NL in 2007, but he finished second in the league with 16 losses due to poor run support.
In 2009, Cain was named an All-Star for the first time in his career; he won 14 games and had a winning record for the first time since 2006. Cain only won 13 games in 2010, but he saved his best pitching for the playoffs, as he did not allow an earned run any of the three playoff games he pitched in as the Giants won their first World Series since 1954. In 2011, Cain won 12 games and had a 2.88 ERA. Cain threw the 22nd perfect game in Major League Baseball history on June 13, 2012. He had a 16–5 record during the regular season, and he finished sixth in NL Cy Young Award voting. He won every series-clinching playoff game for the Giants as they won the 2012 World Series.
Cain was born to Tom and Dolores Cain in Dothan, Alabama. He lived in Vincent, Alabama, for a year when his mother taught at a school nearby. Cain also spent part of his childhood in Germantown, Tennessee, where he attended Houston High School. He took lessons on how to pitch from Mauro Gozzo, who lived near the Cains in Tennessee. As a senior at Houston High School, Cain struck out 83 batters in 62 innings pitched while recording a 1.03 earned run average (ERA).
Cain was selected by the San Francisco Giants in the first round (25th overall) in the 2002 Major League Baseball (MLB) Draft. He began his professional career in 2002 with the rookie Arizona League Giants. In eight games (seven starts), he had an 0–1 record, a 3.72 ERA, 20 strikeouts, and 11 walks in 19 1⁄3 innings pitched. He spent 2003 with the Hagerstown Suns of the Single-A South Atlantic League. In 14 starts for the Suns, he had a 4–4 record, a 2.55 ERA, 90 strikeouts, and 24 walks in 74 innings pitched.
Prior to 2004, Cain was ranked the number two prospect in the Giants' organization (behind Merkin Valdez) by Baseball America. Cain spent 2004 with two teams. He began the season with the San Jose Giants of the Single-A advanced California League. In 13 starts, he had a 7–1 record, a 1.86 ERA, 89 strikeouts, and 17 walks in 72 2⁄3 innings pitched. In June, he was promoted to the Norwich Navigators of the Double-A Eastern League. In 15 starts, he had a 6–4 record, a 3.35 ERA, 72 strikeouts, and 40 walks in 86 innings pitched. Cain led Giants' minor league prospects in wins, strikeouts, and ERA; he was named the Giants' Organizational Player of the Year.
Baseball America ranked Cain as the 13th-best prospect in baseball in 2005, as well as the Giants' top prospect. Cain attended spring training in 2005, but he began the season with the Fresno Grizzlies of the Triple-A Pacific Coast League (PCL). In 26 starts, Cain had a 10–5 record and 145 2⁄3 innings pitched. He finished fifth (tied with R.A. Dickey and Adam Wainwright) in the PCL in wins and fourth with a 4.39 ERA (behind Kevin Jarvis's 3.38, Chris Oxspring's 4.03, and Édgar González's 4.37). He led the league with 176 strikeouts.
Cain was called up to the Giants on August 26, 2005, to join their rotation. He made his major league debut on August 29, at the age of 20 against the Colorado Rockies; he gave up only three hits and two runs in five innings but still ended up losing the game. He earned his first major league win on September 4 allowing one run in seven innings against the Arizona Diamondbacks. He notched his first complete game, a two-hitter, against the Chicago Cubs on September 9. Cain finished his first season with seven starts over 46 1⁄3 innings in which he posted a 2–1 record, 30 strikeouts, a 2.33 ERA, a 0.928 walks plus hits per inning pitched (WHIP), and a minuscule .151 opponent batting average.
When he was called up, Cain was the second youngest player in the major leagues (Félix Hernández of the Seattle Mariners was the youngest).
Cain's 2005 performance was impressive enough that manager Felipe Alou named him to the team's 2006 starting rotation before spring training began. Cain began the season as the team's fourth starter. Entering the season, he was again ranked as the Giants' top prospect by Baseball America, which also named him the 10th-best prospect in baseball.
In 2006, Cain struggled with consistency, but showed signs of dominance in several starts, flirting with a no-hitter on more than one occasion. On April 24, Cain did not allow a base runner until the sixth inning in a win over the New York Mets. On May 21, Cain pitched his first complete game shutout, a one-hitter against the Oakland Athletics. On June 19, Cain pitched 7 2⁄3 innings of no-hit ball against the Los Angeles Angels of Anaheim before finally surrendering a single to Chone Figgins.
Late in the season, Cain increased his chances for Rookie of the Year consideration with a run of remarkable pitching. From August 17 to September 14 Cain recorded a 5–0 record with an ERA of 0.21. During this streak, he allowed just one earned run in 42 innings—and did not allow an earned run in 30 2⁄3 innings. He led all National League (NL) rookie pitchers with 13 wins, 179 strikeouts, and 190 2⁄3 innings pitched in 2006. His 2006 record was 13–12, with a 4.15 ERA. Cain finished in a fifth-place tie with Andre Ethier in the NL Rookie of the Year voting.
Cain began 2007 as the Giants' number two starter. In April, he had a 1.54 ERA with 12 hits in 35 innings pitched. On April 22, he pitched a complete game allowing one run (in the ninth) and three hits in a 2–1 victory over Arizona. It was the third complete game of his young career. Cain's record through August 3 was 3–12. He had limited opponents to a batting average of .238 against him during that stretch. The Giants scored two or fewer runs in 20 of Cain's first 30 starts. Additionally, the bullpen blew four leads behind him.
Cain went 4–1 over his next five starts. This stretch was bolstered in part by a power surge at the plate by Cain himself. He hit his first and second career home runs in these starts, off Tim Redding of the Washington Nationals and Cubs' ace Carlos Zambrano. In September, he had an 0–3 record.
Cain finished the season with the 10th-lowest ERA in the NL at 3.65. He had a 7–16 record; his 16 losses were second in the league (Kip Wells had 17). The Giants went 9–23 in his starts; the bullpen lost leads in five of his starts and the team scored 2 runs or fewer in 21 of his starts. He had 163 strikeouts and 79 walks in 200 innings pitched; he led the league with 12 wild pitches.
On April 12, 2008, Cain took a no-hitter into the seventh inning against the St. Louis Cardinals before allowing a leadoff double to Albert Pujols; he allowed two runs in 6 2⁄3 innings and hit a home run against Todd Wellemeyer but received a no-decision as the Giants lost 8–7 in 10 innings. He allowed two runs in eight innings and hit a home run against Brandon Backe on May 13, earning the win as the Giants defeated the Houston Astros 4–2. He struck out a season-high 11 batters on June 15 while giving up three runs in seven innings, but he took the loss as the Athletics beat the Giants 4–0. He threw eight shutout innings on July 1, striking out 10 and earning the win in a 2–1 victory over the Cubs. On July 24, despite battling the flu, Cain threw a shutout, helping the Giants beat the Nationals 1–0. Cain went 8–14 with a 3.76 ERA. He had 186 strikeouts (tied with Ricky Nolasco for eighth in the league) and 217 2⁄3 innings (fifth in the league). His 14 losses were tied for fourth in the league with Johnny Cueto, Backe, Braden Looper, and Zach Duke (behind teammate Barry Zito's and Aaron Harang's 17 and John Lannan's 15); he was one of eight NL pitchers to make 34 starts. Cain's season record was deceiving, as he received the lowest run support in the NL.
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.
Cain finished the 2009 season with a 14–8 record in 33 starts. He had a 2.89 ERA (seventh in the NL), 171 strikeouts, 73 walks, and 217 2⁄3 innings pitched (seventh). He was tied for first in complete games thrown (four) with teammate Tim Lincecum. He finished ninth in the league with a .636 winning percentage. He finished the season with a career-high in wins and winning percentage.
In 2010, Cain was part of a rotation that included 2008 and 2009 NL Cy Young Award winner Lincecum, 2002 American League Cy Young Award winner Barry Zito, Jonathan Sánchez, and Wellemeyer (who was replaced midseason by Madison Bumgarner). On May 22, Cain threw a complete game and allowed just one run but was charged with the loss as Oakland defeated the Giants 1–0. In his next start, on May 28, Cain shut out the Diamondbacks, allowing one hit (a double by Mark Reynolds) as the Giants won 5–0. In the month of May, Cain pitched into the sixth inning or later in all six of his starts while giving up nine earned runs on 23 hits with 35 strikeouts and 18 walks in 44 2⁄3 innings pitched with an overall record of 3–3 and a 1.81 earned run average. On August 1, for the first time in his career, Cain defeated the Los Angeles Dodgers by throwing 7 2⁄3 scoreless innings in a 2–0 victory. He took a no-hitter into the eighth inning on September 26 against Colorado before finally allowing a one-out single to Jay Payton; Cain wound up allowing two runs while throwing a complete game in a 4–2 victory over the Rockies.
For the season Cain was 13–11 with a 3.14 ERA, 177 strikeouts, and 61 walks. He finished sixth in the league with a 1.08 WHIP and 223 1⁄3 innings pitched. He tied for third with four complete games (tied with Ubaldo Jiménez and Johan Santana behind Roy Halladay's nine and Wainwright's five), including two shutouts (which made him one of seven players in the NL to throw two or more shutouts). He tied for 12th in NL Cy Young Award voting with Bronson Arroyo.
Cain reached the playoffs for the first time in his career as the Giants won the NL West to reach the playoffs for the first time since 2003. In Game 2 of the NL Division Series against the Atlanta Braves on October 8, Cain allowed one unearned run in 6 2⁄3 innings but received a no-decision as the Giants lost 5–4 in 11 innings. In Game 3 of the NL Championship Series against the Philadelphia Phillies on October 19, he threw seven shutout innings and earned the win in a 3–0 victory over the Phillies. The Giants defeated the Phillies in six games. On October 28, Cain capped an impressive post-season performance as he pitched 7 2⁄3 scoreless innings in Game 2 of the World Series against the Texas Rangers (a 9–0 Giants' victory) to become the fifth pitcher to pitch at least 20 innings in the postseason without allowing an earned run. His total post-season stats of a 2–0 record, with a 0.00 ERA through 21 1⁄3 innings pitched helped the Giants win their first championship in San Francisco.
Cain threw a complete game against the Nationals on June 8, 2011, striking out 11, allowing one run, and hitting an RBI double against Yunesky Maya in a 3–1 Giants victory. On June 25, he threw seven shutout innings (retiring 14 hitters in a row at one point) and earned the win in a 1–0 victory over the Cleveland Indians. On June 30 at Wrigley Field, Cain struck out the Chicago Cubs' Koyie Hill for his one-thousandth career strikeout, becoming the fifth San Francisco Giants pitcher to reach the milestone. Also, he again threw seven shutout innings but received a no-decision this time in the Giants' 13-inning, 5–2 loss to the Cubs. He was an All-Star for the second time in his career in 2011; however, he did not appear in the All-Star Game because he started the final regular season game prior to the All-Star contest. He had a 2.64 ERA in 14 starts after the All-Star break but earned just four wins in that stretch. On July 27, Cain allowed an unearned run in seven innings, earning the win in a 2–1 victory over the Phillies. Cain had one strikeout and one walk in the game, ending his Giants' record (since 1900) of 39 consecutive starts with more strikeouts than walks. On September 18, Cain allowed five runs (three earned) in five innings and hit his fifth career home run against Esmil Rogers, earning the win as the Giants defeated Colorado 12–5. In 33 starts, Cain had a 12–11 record, 179 strikeouts, and 63 walks. His 2.88 ERA was eighth in the league, and his 221 2⁄3 innings pitched were seventh in the league. He finished eighth in Cy Young Award voting.
On April 2, 2012, Cain agreed to a five-year contract extension worth a guaranteed $112.5 million through 2017 with an option for 2018, at the time surpassing Kevin Brown for the largest deal for a right-handed pitcher. Cain earned a $5 million signing bonus, and will earn $20 million each season from 2013–17. His $21 million option for 2018 will vest automatically if he is not on the disabled list to an elbow or shoulder injury in 2017 and if he reaches 400 innings in 2016 and 2017 combined. If the option fails to vest, the Giants can either pick up the $21 million option or pay a $7.5 million buyout. Cain was scheduled to become a free agent after the 2012 season.
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).
Cain had a 16–5 record in 2012. He tied with six other players for sixth in the NL in wins, finished fourth with a 2.79 ERA (behind Clayton Kershaw's 2.53, Dickey's 2.73, and Cueto's 2.78), and finished third with 219 1⁄3 innings pitched (behind Dickey's 233 2⁄3 and Kershaw's 227 2⁄3). He finished eighth with 193 strikeouts, joining teammates Bumgarner and Lincecum among the top 10 in the NL in that category. He was one of seven NL players to throw two or more shutouts. Cain finished sixth in NL Cy Young Award voting.
Cain reached the playoffs for the second time in his career as the Giants won the NL West after missing the playoffs in 2011. In Game 1 of the NL Division Series against the Cincinnati Reds on October 6, he allowed three runs in five innings and took the loss as the Reds defeated the Giants 5–2. In Game 5 on October 11, he began the game with four scoreless innings; Cain would allow three runs over 5 2⁄3 innings as the Giants won 6–4 to advance to the next round of the playoffs. In Game 3 of the NLCS against the Cardinals on October 17, Cain allowed three runs in 6 2⁄3 innings and was charged with the loss as the Giants lost 3–1. On October 29, in Game 7, Cain threw 5 2⁄3 shutout innings and earned the win as the Giants won 9–0, marking the second time in the playoffs that Cain had won a series-clinching game. In Game 4 of the 2012 World Series against the Tigers on October 28, Cain allowed three runs in seven innings, earning a no-decision as the Giants won 4–3 in 10 innings to win the World Series for the second time in three years.
On June 13, 2012, in a 10–0 victory, Cain threw the 22nd perfect game in MLB history, against the Houston Astros, striking-out a career-high 14 batters (tying Sandy Koufax for the most strikeouts in a perfect game). It was the first perfect game for the Giants franchise (first in San Francisco), the ninth in NL history, the fifth no-hitter thrown by MLB pitchers in 2012, and the second perfect game of the season after Chicago White Sox pitcher Philip Humber threw one on April 21. Cain threw 125 pitches, the most by a pitcher in a perfect game, and received the most run support ever for a pitcher throwing a perfect game. Cain also singled against Rhiner Cruz and scored in the fifth inning. San Francisco Mayor Ed Lee, in recognition of the perfect game, presented Cain with the key to the city and made a proclamation that June 13 every year will be known as "Matt Cain Day". In addition, Cain set a franchise record for a single-game score at 101 and is currently the first and only Giants pitcher to break the 100 barrier.
Cain started on Opening Day for the Giants in 2013. He pitched six shutout innings before being removed due to a high pitch count; however, Kershaw threw a shutout, and the Dodgers beat the Giants 4–0. On April 7, Cain threw two no-hit innings before giving up nine runs in the third inning and getting removed from the game, becoming the first Giants to allow nine runs in an inning since Ernie Shore in 1912. The Cardinals beat the Giants 14–3. On August 23 against the Pirates, Cain was hit by Gaby Sánchez's line drive in the pitching arm, and was placed on the 15-day disabled list for the first time in his career. Cain would finish the season with a record of 8-10 in 30 starts. For the first time since 2006, Cain's ERA sat in the 4's, finishing with an exact 4.00 ERA.
Cain started the 2014 season 1–3 with a 3.66 ERA in his first eight starts, before being placed on the 15-day DL with a strained right hamstring on May 30, 2014. Bruce Bochy stated that after the All Star break, Cain would move from the second place in the Giants starting rotation to fifth. Bochy added that Cain falling in the order had more to do with everyone else's successes than any shortcomings of Cain.
On July 4 at Petco Park, Cain struck out the San Diego Padres' Tommy Medica for his 1,500th career strikeout, becoming the eighth pitcher in franchise history and the fourth pitcher in the San Francisco Era after Juan Marichal, Gaylord Perry, and Tim Lincecum to reach the milestone.
Cain struggled for the remainder of the season before being sidelined due to elbow difficulties in July, pitching his last game on July 9, 2014. He ended the season with a 2–7 record and a 4.18 ERA. Before undergoing surgery on his right elbow to remove bone chips on August 11, Cain revealed that he had pitched through bone chips for ten years, but that they had never been an issue until then. In late September, Cain underwent surgery on his right ankle to remove a bone spur. The Giants acquired Jake Peavy a few days before the trade deadline to fill in as a starting pitcher and went on to win the 2014 World Series. Cain won his third World Series ring in five years.
After recovering from elbow surgery, Cain gained more range of motion in his pitching arm, saying, "I feel like I'm 18 again." Before he could make his first regular-season start, Cain was placed on the disabled list with a flexor tendon strain in his right forearm.
In only 13 appearances (11 starts) in 2015, Cain went 2–4 and posted a career-worst 5.79 ERA. He also posted his lowest K/9 of his career while allowing more hits than innings pitched.
After starting the season 1-5, Cain was placed on the disabled list on May 28 with a hamstring injury. After missing almost two months due to a hamstring injury, the Giants activated Cain off the disabled list on July 20.
On July 31 at AT&T Park, in a 3-1 win over the Washington Nationals, Cain won his one-hundredth career game by tossing five no-hit innings on ninety-three pitches, making him the sixth pitcher in the San Francisco Era and the twenty-third pitcher in Giants franchise history to win at least one hundred games. Cain is the second Giant on the 2016 season to earn his one-hundredth career victory after teammate Johnny Cueto won his on April 26. For the second straight season, Cain's ERA hovered in the high 5, finishing with a 5.64 ERA while starting 17 games for the Giants. Cain was left off the Giants 2016 Postseason Roster.
On May 15 at AT&T Park, in an 8-4 win over the Los Angeles Dodgers, Cain surpassed two thousand career innings pitched. Cain becomes the twelfth pitcher in franchise history and joins Hall of Famers Juan Marichal and Gaylord Perry and the only three pitchers in the San Francisco Era to reach the milestone.
On July 24 at AT&T Park against the Pittsburgh Pirates, Cain struck out his 1,678th career batter, surpassing Carl Hubbell for fifth place in franchise history.
He made several appearances in relief during the second half of the 2017 season and recorded his first career hold in August against the Milwaukee Brewers.
Cain features a mix of mostly four pitches: a four-seam fastball (90–93 mph), a cutter (84–87), a curveball (76–79), and a changeup (83–86). Increasingly, he also throws a two-seam fastball at 89–91 mph. Cain leads with his four-seamer, throwing it over half the time in his career. His changeup is his secondary pitch to left-handed hitters, while he throws cutters as a secondary pitch to right-handed hitters. Cain throws curveballs in roughly equal proportions to righties and lefties.
Cain met his wife Chelsea Williams during spring training while she was a student at Arizona State University majoring in sociology. At the time, Chelsea was waitressing at a local steakhouse. The two married in fall 2009 and had their first child, daughter Hartley, in December 2010. They have homes in Arizona, Tennessee, and Orinda, California. As a hobby, Cain enjoys hunting. In addition, he supports Project Open Hand, and has expressed his support for same-sex marriage by appearing in the "No H8" photo campaign opposing California's Proposition 8.