Lee and a 2016 second-round pick wind up with the Grizzlies, who parted with Bayless in a much-discussed swap first reported to be in the works last week.
The Thunder sent forward Ryan Gomes to Boston and received cash considerations as well as two conditional second-round picks.
Bayless is averaging 8.0 points and 2.0 assists this season while shooting 37.5 percent from the field. He has played in 30 games for Memphis this season, including five starts. He is making $3.1 million in the final year of his contract.
The Celtics have been trying to rid themselves of Lee and his contract, which has two more seasons to run at a little more than $11 million after this season.
The Grizzlies have nearly $7.5 million left of a trade exception they created in January 2013 by dealing Rudy Gay to Toronto. They will use that to help pay Lee, who is averaging 7.2 points this season and is shooting 44.2 percent from three-point range. The Grizzlies need another perimeter threat.