The Grizzlies also received four second-round draft picks as part of the trade; two of the picks were from the Hornets and two were from the Heat.
Lee joins a Hornets team that is eighth in the Eastern Conference at 27-26. He is in his eighth NBA season and has established a reputation as a coveted "3-and-D guy," who can knock down open 3-point shots and serve as a capable defender on the wing.
"We are excited to be adding a quality veteran wing player to our roster in Courtney Lee," Hornets general manager Rich Cho said in a statement. "Courtney has proven to be a team defender, a consistent outside shooter and a solid scorer in our league for the past eight years. Particularly in terms of experience, he adds depth to our roster in a position of need for us and we expect him to fit in to our system and contribute right away."
Hairston and Andersen join a Memphis team expected to be without center Marc Gasol (foot) for the remainder of the season. Hairston, a second-year forward, has shown potential but has also dealt with off-the-court issues. He has started 43 games for Charlotte this season, averaging 6.0 points and 2.7 rebounds in 19.7 minutes per game.
Andersen was a valuable role player during the Heat's run to a championship in 2012-13 and their return to the NBA Finals the following season. But he has played in only seven games this season, the final year of his contract.
"Chris Andersen was absolutely essential in our 2013 NBA Championship run," Heat president Pat Riley said. "We want to thank him for his contributions, and we wish him nothing but the best. He will always be considered part of the Heat family."
The deal also creates more flexibility going into this summer, with Andersen in the final year of his contract.
With Goran Dragic and Beno Udrih already cemented as the top two point guards, Roberts doesn't figure to factor immediately into the Heat's plans on the court, although he could help replace injured guard Tyler Johnson.
But the deal helps the Heat move closer to escaping the luxury tax.
Three-team deal with Memphis and Charlotte has left the Heat at $3,526,460 over the luxury-tax line, compared to $5,671,520 over beforehand.— Marc Stein (@ESPNSteinLine) February 16, 2016
Information from The Associated Press was used in this report.