Ryan Doumit had three hits, James McDonald pitched into the eighth inning for the first time this season and the Pittsburgh Pirates beat the Houston Astros 3-1 on Monday.

Josh Harrison added two hits and Derrek Lee hit his 16th homer of the season — and fourth with Pittsburgh — as the Pirates won for the third time in four games. It was Lee's fourth homer since he was acquired in a trade with Baltimore on July 30.

Joel Hanrahan worked the ninth for his 35th save.

Houston starter Henry Sosa (2-3) allowed two runs and six hits in six innings. The Astros have lost four straight.

McDonald (9-7) needed just 91 pitches to get through 7 1-3 innings at PNC Park, allowing one run and three hits.