The 32-year-old was 9-10 with a 4.57 ERA in 25 starts and 12 relief appearances last year for the Los Angeles Angels, including a 4-0 record in five September starts. He has a 42-47 record and a 4.35 ERA in eight seasons with San Francisco (2003-05), the Chicago Cubs (2005-06), Washington (2007) and the Angels.
The deal was completed Thursday, two days after the sides reach the agreement.
In addition to the guaranteed salary, Williams can earn $1 million in performance bonuses -- receiving the greater amount he earns for either starts or innings. He would get $200,000 apiece for 12, 15, 20, 25 and 30 starts, and $100,000 each for 120 innings and every 10 additional innings through 210.
To make room on the roster, the Astros designated infielder Brett Wallace for assignment. The 27-year-old, a first-round draft pick by St. Louis in 2008, had spent four seasons with the Astros and hit .221 last year, when he set career bests with 13 homers and 36 RBIs.