The government would help struggling homeowners get new, cheaper loans and be allowed to offer troubled mortgage giants Fannie Mae and Freddie Mac a cash infusion as part of legislation that aims to calm the chaotic housing market.

A home is advertised for sale at a foreclosure auction in Pasadena, California.

The House was expected to vote on the bill Wednesday, and it could become law as early as this week.