Cust's deal, announced Wednesday, includes a 2013 team option.
The 33-year-old hit .213 with three homers and 23 RBI in 67 games for the Mariners, who released him on Aug. 4. The Phillies signed him to a minor-league contract eight days later, then cut him on Aug. 21.
Cust has spent time at designated hitter, which the Astros will need when they move to the American League in 2013.
He has 105 homers, 323 RBI and 819 strikeouts in 670 big league games.
The Astros designated catcher Craig Tatum for assignment to make room for Cust on the 40-man roster.