Houston acquired Raley from the Cincinnati Reds in exchange for a player to be named later, the Astros announced Sunday.
Osuna is sidelined with elbow soreness and will likely require his second Tommy John surgery in seven years.
Raley, 32, reports to Houston this week before being added to the Major League roster, where he is expected to contribute to the Astros' bullpen.
He made four appearances for the Reds this season before being designated for assignment last Thursday.
Raley pitched four total innings, giving up five hits and four runs. He struck out six and walked two.
This is Raley's first season back in Major League Baseball since 2013, He spent the last five seasons with the Lotte Giants in the Korean Baseball Organization (2015-19).
In 2019, Raley made 30 starts for Lotte posting a 3.88 ERA (78ER/181IP).
Raley, a South Texas native who played college baseball at Texas A&M, has posted at least 30 starts, 178.1 innings and 134 strikeouts in each of his five seasons in the KBO.
Raley was one of only two pitchers in the KBO to have at least 150 starts and at least 900 innings pitched over that span.
The Reds signed Raley to a minor league contract in January and invited him to spring training.