HOUSTON -- The New York Mets' season may not be a lost cause just yet.
Suddenly, things don't seem so bad after they piled up 38 hits and 22 runs in three days at Minute Maid Park to win a road series for the first time since early June.
"When you get a number of guys swinging the bats the way we're swinging the bats right now, you feel very confident that you can get something done," said Mets manager Jerry Manuel.
The Mets also got consecutive impressive starts in Houston, from Jonathon Niese in Saturday's 10-3 win before Hernandez 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 scored 18 runs in two games after scoring fewer than five in 15 of its previous 20.
The Mets open a 10-game homestand against Colorado on Monday with renewed optimism.
"The last two games, we've played great ball," said Francoeur. "It's big momentum for us coming home. We've got a shot."
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.
"I did nothing right," Moehler said. "I didn't locate, I didn't pitch smart, I had nothing. It was just poor everything."
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.
Hernandez got a shot of confidence from the good defensive play.
"Plays like that keep you on the mound," Hernandez said. "They saved one run. That was big."
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 earned 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. He has multiple RBIs in four of 12 starts in New York and said his transition from the Braves has gone better than he expected it would.
"From the coaches to the players, they've instilled a confidence in me," he said. "I feel comfortable at the plate, I feel that I'm going to be able to get a hit."
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 Mets won a series in Houston for the first time since September 2006.