He was drafted in the 12th round of the 2005 amateur draft, and began his professional career the same year. He played for the Salem-Keizer Volcanoes in 2005, going 4–3 with a 4.30 ERA in 15 games. In 2006, he played for the Augusta Greenjackets, going 15–5 with a 2.99 ERA in 26 starts. For the San Jose Giants in 2007, Martinez went 10–10 with a 4.26 ERA in 28 starts, and in 27 starts with the Connecticut Defenders in 2008 he went 10–10 with a 2.49 ERA. Martinez had his first win during his Major League Baseball debut on April 7, 2009. He pitched two innings, walking and striking out one but also gave up two earned runs, giving him an ERA of 9.00. Like many other San Francisco Giants on the 2009 opening day roster, he is a homegrown talent. Martinez, along with four other Giants, made their first opening day debuts. These players include Fred Lewis, Pablo Sandoval, Travis Ishikawa and Emmanuel Burriss. On April 9, while pitching in the 9th inning, he suffered a direct line-drive hit off the bat of Mike Cameron to his forehead and sustained a laceration and a nose bleed. He was able to walk off the field unaided, but was taken immediately to nearby St. Francis Memorial Hospital where it was determined he had a concussion and three fractured bones, but the CT scan did not turn up anything that looked serious. He remained in the hospital for overnight observation, and stayed there for the next few days. On August 5, 2009, Martinez returned to the major leagues, starting in a game against the Houston Astros. He replaced Ryan Sadowski in the pitching rotation. Martinez went on to win the game, lasting 5 innings, allowing 3 runs, with no walks and 4 strikeouts. On August 28, 2009, Martinez was optioned down to Triple-A Fresno after giving up 8 runs in an 11-0 loss to the Arizona Diamondbacks. Martinez attended spring training with the Giants in 2010, but he was optioned to Fresno on March 23. Due to an injury to Todd Wellemeyer, Martinez started for the Giants against the Orioles on June 15, 2010; he took a loss. Scheduled to pitch against the Red Sox a week later, the Giants decided to go with Madison Bumgarner, sending Martinez to the bullpen until his trade.
On January 4, 2011, he was traded by the Pirates to the Cleveland Indians for cash considerations. Martinez was outrighted to the Triple-A Columbus Clippers on February 18, 2011, to make room on the 40-man roster for Orlando Cabrera.
Arizona Diamondbacks
Martinez signed a one-year contract with the Arizona Diamondbacks on December 5, 2011. On April 24, 2012, after going 0-1 with a 4.42 ERA in 3 games with Triple-A Reno, Martinez was recalled to Arizona. Martinez pitched in 1 game there, giving up a run in 1 inning, before being optioned back to Reno when Patrick Corbin was called up to make a start.
Cleveland Indians
Martinez signed a minor-league contract with the Indians before the 2013 season. He was added to the major-league roster on June 29, 2013 and made an appearance in that day's game. Martinez filed for free agency on October 1, 2013.