Myers gave up five runs in the first three innings and Houston couldn't recover, losing 7-5 to the Milwaukee Brewers on Saturday night.
"It didn't start out good," Myers said of his latest start.
With his team down 5-1, Martinez took Brewers left-hander Chris Naverson deep in the bottom of the third to score catcher Humberto Quintero and fellow rookie Jose Altuve to cut Milwaukee's lead to one run.
"I was just coming up, trying to hit something hard to get something going," Martinez said. "Just got a good piece of it."
Astros manager Brad Mills credited Martinez for "really getting us back in the thing."
The Astros never got closer, however, dropping to 3-8 against the Brewers this season.
Houston mustered only five hits against Naverson (8-6) and were kept in check by the Brewers' bullpen the rest of the way.
The teams traded home runs in the ninth, with Barmes hitting his eighth of the season to left off closer John Axford.
Axford picked up his 32nd save of the season after Astros rookie J. B. Shuck was thrown out trying to reach third on a single and a throwing error by Axford.
Prince Fielder hit a slider from Myers deep to right field for a three-run home run in the first inning. Fielder's 25th home run of the season scored Corey Hart and Nyjer Morgan, who singled and bunted, respectively, to start the inning.
Fielder came within a triple of the cycle, adding a single in the third and an RBI double in the sixth to cap the scoring for Milwaukee, winners of 10 of 11.
For Myers (3-12), it was the 27th home run surrendered this season, five of which have been to the Brewers.
"I told him it was a good piece of hitting," Myers said. "I thought it was going to hit him, and he did a good job of pulling his hands in and kept it fair." A pitcher known for giving up home runs, he is four away from tying a career high of 31 reached twice, last in 2005 while with Philadelphia . Myers gave up 20 home runs in 2010.
His 12th loss put him within one of tying a career high set in 2008, also with Philly.
The Brewers got to Myers for two more runs in the third inning, but not without controversy.
The Astros, however, took issue with the call, arguing it should have been a foul. Mills discussed the call with home-plate umpire Gary Cederstrom.
On the next at-bat, Cederstrom called Fielder safe at home plate, scoring on a fielder's choice.
Mills again approached Cederstrom to protest the call for several minutes, arguing Fielder was out.
"The ball was foul down the line," Myers said of Betancourt's hit. "I asked (third baseman) Jimmy (Paredes) and I asked (Humberto Quintero) and they said the ball was at least a foot and a half foul, so I thought they missed that one.
"The play at the plate, I was like, whatever," he said. "It was kind of the way it was going tonight, so it's the way it is."
Myers left after six innings having given up six runs — five earned — on 11 hits, with one walk and five strikeouts.
"That third inning was just a debacle, I thought," Myers said. "I thought they missed a couple of calls there. Replays showed the missed a couple of calls, but that's the way the game goes. "It's human error; it's their judgment call. It's the way it goes."
Lee first put the Astros on the scoreboard with a solo homer to left in the second inning to make it 3-1 Brewers. It was Lee's 11th home run of the season.
NOTES: With the victory, the Brewers guarantee just their fourth road series win of the season. Axford has now converted 29 consecutive save opportunities. Houston recalled RHP Jeff Fulchino and LHP Wesley Wright from Oklahoma City. The Astros optioned LHP J.A. Happ to Triple-A Oklahoma City and placed RHP Enerio Del Rosario on the 15-day disabled list with a strained right shoulder prior to the game. Happ is 4-14 with a 6.26 ERA this season. ... RHP Zack Greinke (9-4) starts the finale of the three-game set on Sunday against RHP Bud Norris (5-7).