Thomas was 16-20-3 with a .909 save percentage and 2.87 goals-against average this season for the Panthers. He did not play in 2012-13, but returned to the NHL on a one-year contract with Florida.
"Tim is a proven goaltender in this League that has won the big games when they matter the most," Stars general manager Jim Nill said in a statement. "We have 20 games left in just 39 days, including four sets of back-to-back situations, and adding a player of Tim's caliber helps our depth at the goaltender position."
After trading for Luongo from the Vancouver Canucks on Tuesday, Florida general manager Dale Tallon said he would speak to Thomas about what he wanted to do. Thomas has a no-movement clause in his contract.
Ellis has one more year on his contract with an average annual value of $900,000. He is 5-6-0 in 14 appearances for the Stars with a .900 save percentage and a 3.04 GAA.