Livan Hernandez struck out a season-high seven after a rough start, and the New York Mets put together another well-balanced offensive performance in an 8-3 win over the Houston Astros on Sunday.

Hernandez (7-5) allowed only four singles after the Astros built a 3-0 lead in the first inning. He threw 107 pitches in seven innings and won his second straight start after losing the previous four.

Luis Castillo, Jeff Francoeur and David Wright drove in two runs apiece for the Mets, who had at least 12 hits for the third straight game. New York beat Houston 10-3 on Saturday after scoring fewer than five runs in 15 of its previous 20 games.

Houston's Brian Moehler (7-6) gave up five runs on eight hits in 4 2-3 innings, his shortest outing since June 9. He lost for the second time in seven starts.

But Hernandez was the pitcher in trouble early, needing 36 pitches to escape the first inning. Kaz Matsui walked with one out before Miguel Tejada, Carlos Lee and Geoff Blum hit consecutive doubles. Blum tried to score on Hunter Pence's single up the middle, but Angel Pagan threw to catcher Brian Schneider for the out at the plate.

The Mets answered with three runs in the third.

Pagan reached on a fielder's choice and scored on Castillo's triple to right. Wright followed with an RBI single and scored later in the inning on Francoeur's sacrifice fly.

Alex Cora singled with one out in the fourth and scored on Pagan's triple. Castillo then laid down a bunt in front of the pitcher's mound and Pagan scored when Ivan Rodriguez couldn't handle Moehler's hurried throw home.

Alberto Arias started the eighth for Houston and Cora beat out an infield single. Pinch hitter Jeremy Reed then tripled to right center and Cora scored, the first run allowed by Arias in his last 23 appearances.

Castillo singled off Arias in the ninth and scored on Wright's double to center. Wright came home on Francoeur's single to center. Francoeur has 14 RBIs since joining the Mets on July 10 in a trade from Atlanta.

NOTES: Hernandez made his 400th career start and Moehler made his 300th career appearance. ... Pagan has an eight-game hitting streak. ... Rodriguez struck out swinging three times against Hernandez. ... The Astros dropped to 10-4 in the last 14 games Moehler has started. ... The Astros lost for the fifth time in their last 17 home games. ... Francoeur has multiple RBIs in four of 12 starts with New York.