The Serie A powerhouse have appointed ex- Azzurri boss the veteran manager as their manager for the rest of the term.
The 66-year-old replaces Igor Tudor, who was let go post the Lazio setback last weekend.
Tudor arrived at the club in March to replace Thiago Motta but left after seven months after an eight-game winless streak.
Under Spalletti, Napoli clinched the Serie A championship in 2022-23 before taking charge of Italy, after the team's failure to reach the 2022 World Cup under former boss Roberto Mancini.
He helped them qualify for Euro 2024 but were eliminated in the round of 16 by Switzerland.
Nonetheless, Italy dismissed Spalletti in June post a qualifying defeat against Norway, putting Italy in danger of missing a third straight World Cup.
He has previously coached Inter Milan, Roma, and Udinese in Italy's top flight and secured two Russian Premier League titles with Zenit St Petersburg.
Juventus were temporarily led by Massimo Brambilla for their 3-1 win against Udinese on Wednesday which left them seventh in Serie A - six points adrift of Napoli at the top after nine rounds.
They are 25th in the league phase of the Champions League, having lost once and drawn twice in their opening three matches.