Danson will take on the role of a new graveyard shift supervisor, replacing Laurence Fishburne's character Dr Ray Langston.
Fishburne left the series in May to pursue other projects after show bosses reportedly declined to renew his contract.
CSI producer Don McGill said: "From the moment we all started talking about the role, it was clear [Danson] couldn't be more perfect.
"Intelligence, wit, warmth, depth of character and emotion, he brings it all. And now he'll have to bring latex gloves, too."
Showrunner Carol Mendelsohn added: "You can create a new character on the page, but until the perfect actor comes along and breathes life into it, it's just words. We're very excited Ted Danson came along."
Danson will also retain his role as series regular George Christopher on HBO's Bored to Death.
The new season of CSI starts on Wednesday, September 21 at 10/9c on CBS.
Watch Ted Danson's cameo in the Beastie Boys' music video for 'Make Some Noise' below: