Milwaukee, which also got cash in the deal, is without top scorer Michael Redd for the rest of the season after he tore ligaments in his left knee in a win against Sacramento on Jan. 24.
"Tyronn is a veteran point guard who fits in well with our style of play," Magic general manager Otis Smith said in a statement. "He shoots well from 3-point range and adds needed depth at that position."
The Bucks are also missing center Andrew Bogut for eight weeks with a stress fracture in his back. Even with the injuries, Milwaukee remains tied for eighth in the Eastern Conference.
General manager John Hammond quickly pointed out that Bogans isn't replacing Redd but that he can earn significant minutes in the role Redd vacated.
"He fills a need for us," Hammond said. "They have a need there with Jameer out right now to have Ty help them some at the point guard spot. We have a need here with Keith with Michael being out."
Nelson tore the labrum in his right shoulder in Orlando's 105-95 loss to the Dallas Mavericks on Monday night. He is deciding over the next few weeks whether to have season-ending surgery or hold off and attempt rehabilitation.
Lue, an 11-year veteran of six teams, played 76 games in his first stint with the Magic in 2003-04 and will help backup point guard Anthony Johnson.
Johnson played well in his new role replacing Nelson, at least for a night. He had a season-high 25 points in the Magic's 125-96 win over the Los Angeles Clippers on Wednesday.
But the Magic (37-11) will face tougher competition than the Clippers, and a steady backup point guard should help them contend with the Boston Celtics and Cleveland Cavaliers in the Eastern Conference.
Lue will help settle the rotation.
"He was fantastic," Bucks coach Scott Skiles said of Lue. "I know ultimately he wants to coach when he's done playing. I think he'd be an excellent coach. I was very fond of him."
Bogans, expected to join Milwaukee on Friday, has played 36 games, including 15 starts, this season for Orlando and is averaging 5.3 points and 3.1 rebounds.
He's bound to get more playing time in Milwaukee while the Bucks try to find a way to win without Redd or Bogut and keep their postseason hopes afloat.
"He has size, he can make the corner 3, he's an athletic, wing-defending type player, which we need in our division, so we'll see," Skiles said.