The Astros announced the deal Monday.
The 33-year-old Bedard started on opening day for Pittsburgh last season. He went 7-14 with a 5.01 ERA in 24 starts. The Pirates released him on Aug. 28 while he was tied for the most losses in the majors.
Bedard walked 56 in 125 2-3 innings. He did, however, strike out a team-record seven straight batters against St. Louis.
Bedard is 63-64 lifetime in nine seasons with Baltimore, Seattle, Boston and Pittsburgh. He went 13-5 with a 3.16 ERA for the Orioles in 2007, striking out 221 in 182 innings. He has not made 25 starts in any year since then and has been beset by injuries, missing the 2010 season because of shoulder trouble.