PHOENIX -- The Arizona Diamondbacks answered quickly after falling behind.
Troy Glaus highlighted a five-run second inning with a two-run homer and Shawn Green and Tony Clark also connected, powering the Diamondbacks to a 7-3 victory over the Houston Astros on Thursday night.
Craig Counsell drove in a run and Glaus also doubled for Arizona, which avoided getting swept by Houston in a series for the first time. The Diamondbacks scored more than three runs for only the fourth time in 15 games.
"We needed to put something together," Glaus said. "You know, we've had opportunities and we haven't taken advantage of them, and today, fortunately enough, we were able to take advantage and answer back."
The loss was just the second in 11 games and third in 18 for Houston, but it allowed Washington to move within one game in the wild-card race.
Arizona rookie Brad Halsey (8-7) remained unbeaten since June, allowing two runs -- one earned -- on eight hits and a walk in six innings. Halsey is 4-0 in six starts since an 11-3 loss to San Francisco on June 28.
He also is 2-0 with a 1.38 ERA against Houston this season.
"I like him," Houston manager Phil Garner said. "I think he's going to be a real good pitcher. He's pitched two real good games against us."
Jose Valverde got the final five outs for his third save.
The Astros scored on a sacrifice fly, groundout and Halsey's fielding error.
Wandy Rodriguez (6-5), another rookie, lost for the first time in four starts. He gave up six hits, including the homers by Glaus and Green, and walked three while allowing six runs in five innings.
The Astros took a 1-0 lead in the second, when Chris Burke tripled with one out and scored on Humberto Quintero's groundout.
Arizona answered with five runs in its half.
Rodriguez walked Clark before Glaus hit his 22nd homer into the left-field seats. Green walked and Luis Terrero and Koyie Hill singled to load the bases, and two more runs scored on Rodriguez's throwing error when the left-hander threw wide trying to pick off Hill at first.
Halsey struck out, but Counsell hit an RBI single.
"They got some guys on and we had one bad play," second baseman Craig Biggio said. "But, once again, they've got a good team over there, and for us to come out here and take two out of three, we'll take it."
Green made it 6-2 with a 418-foot shot that struck the center-field wall above the yellow home run line leading off Arizona's fourth.
The Astros had squeezed out a run in their half when Rodriguez hit the first of three successive, two-out singles. He scored when Lance Berkman's sharp liner back to the mound that skipped up out of Halsey's glove was ruled an error.
Halsey finished the fourth by getting Morgan Ensberg on a called third strike -- his second straight inning ended with the bases loaded.
"Every hitter is a pretty big situation because they can all hit it out of the ballpark, but obviously, with the bases loaded, two outs right there, that was huge," Halsey said.
Halsey was lifted for pinch-hitter Chad Tracy with the bases loaded and one out in the sixth. The decision looked shaky when Tracy grounded into a double play, and reliever Lance Cormier gave up a run in the eighth.
Cormier, who worked a scoreless seventh, got one out in the eighth before hitting Burke and allowing a double by pinch-hitter Jose Vizcaino. Valverde allowed a sacrifice fly to pinch-hitter Orlando Palmeiro before striking out Willy Taveras.
"It depends on where you are," Diamondbacks manager Bob Melvin said about hitting for Halsey, who threw only 84 pitches. "We have a chance to break it open, and I have a bullpen that's rested."
Clark homered against Chad Qualls in the eighth.