Pinch-hitter Mark Loretta hit a tie-breaking grand slam off Aaron Heilman in the eighth inning and the Houston Astros beat the New York Mets 7-3 on Friday night.

Kazuo Matsui, Brandon Backe and Carlos Lee had solo homers, all leading off innings against Pedro Martinez, who made his first start since July 12. Martinez returned to the mound for the first time since the death of his father on July 23, and allowed five hits with five strikeouts in five innings.

Doug Brocail (5-5) got the final two outs of the eighth and Jose Valverde worked the ninth as the Astros won for the fifth time in seven games.

It was Loretta's second career grand slam and fourth career pinch-hit homer.

The Mets loaded the bases with no outs in the seventh but didn't score as three different pitchers each got an out. The Astros, however, didn't squander their chance when they did the same in the eighth.

Miguel Tejada led off with a single against Heilman (1-5) and Lance Berkman followed with a ground-rule double to center. Heilman intentionally walked Lee to get to Hunter Pence, who grounded into a forceout at home.

Loretta then hammered a 1-0 pitch into the porch in left field, his second pinch-hit homer this season. It was the fifth pinch-hit homer for the Astros this season and their second grand slam in three games. Lee hit one in a 6-2 win over Cincinnati on Tuesday.

Backe entered the game with an 8.18 ERA in first innings this season and the Mets scored in the opening frame.

Jose Reyes led off with a single to center, advanced on Endy Chavez's bunt and scored on David Wright's single. Wright has 14 RBIs in his last 14 games.

Matsui tied it in the bottom of the inning, hitting Martinez's sixth pitch off the top of the bullpen fence in right for his third homer of the season.

Backe led off the third with a homer to center, his second of the season and fourth of his career. Martinez retired the next three hitters, striking out Tejada and Berkman to end the inning.

Backe, meanwhile, retired nine straight batters following Wright's hit. With two outs in the fourth, the Mets strung together four straight singles to take a 3-2 lead.

Lee led off the fourth with a towering home run to center, his 25th. The Astros led off three innings with home runs for the first time since June 10, 2005, against Toronto, according to the Elias Sports Bureau.

Pence and Humberto Quintero singled later in the inning, but Martinez struck out Backe to end the threat. Mets manager Jerry Manuel said before the game that he wanted Martinez to throw about 70-80 pitches after his layoff and Martinez threw 75 in the first four innings.

Martinez took the mound for the fifth and walked Matsui on four pitches. Tejada helped Martinez by grounding into a double play and Berkman grounded out on Martinez's 87th pitch.

Joe Smith relieved Martinez for the sixth and set down the Astros in order.

The Mets loaded the bases with no outs on three straight singles in the seventh, but Houston's bullpen pitched out of the jam.

After Reyes singled to right to load the bases, left-hander Tim Byrdak relieved Backe and struck out Chavez. Houston manager Cecil Cooper then brought in Chris Sampson, who got Wright to ground into a forceout. Left-hander Wesley Wright replaced Sampson and retired Carlos Delgado on a fly to left.

Notes:@ The Mets reached 10 hits for the 19th time in their last 29 games. ... Manuel said LHP Oliver Perez will start Sunday's series finale in place of RHP John Maine. Maine is nursing a strained rotator cuff and Manuel said he'll throw two bullpen sessions before making his next start against Florida next Friday. ... Astros CF Michael Bourn was out of the lineup for the fifth straight game with a sprained right ankle.

(This version CORRECTS that slam was second of Loretta's career, sted fourth.)