With ice packs and massages failing to provide relief, third-ranked Djokovic became increasingly woozy and was forced to retire while trailing 6-7 (3), 6-4, 6-2, 2-1, allowing the seventh-seeded Roddick to move into the semifinals.
The 26-year-old American will face second-ranked Roger Federer, now within two victories of a record-tying 14th Grand Slam after routing No. 8 Juan Martin del Potro of Argentina 6-3, 6-0, 6-0. Federer, with a 15-2 record against Roddick, ran off the last 13 games.
"Playing Andy is always nice," the 27-year-old Federer said. "We've had some big matches over the years and it's always a pleasure to play against him because he brings energy to the court with his serve and his character. It's nice to play somebody my age. Everyone's so young now."
Djokovic said he was cramping and sore, and "didn't really have time to recover" from his previous match, which ended at 2:26 a.m. Monday.
"Conditions were extreme today. It did affect more on me than him, as you could see," Djokovic said of temperatures that reached 95 degrees. "But, you know, that was the situation. I just have to cope with it. Really tried my best, but sometimes you can't fight against your own body."
Roddick, meanwhile, looked as fit as ever. After losing 15 pounds with a tough offseason workout regimen under new coach Larry Stefanki, he was quicker and his backhand stronger. The match left little doubt about the American's stamina on another sweltering day with not a cloud in the sky.
"It's rewarding to come out on a day like today, when it's pretty hot, and feel pretty good. That's what you do the work for," Roddick said.
While the crowd in the night match was definitely pro-Federer, with Swiss flags abounding, it began backing the increasingly dispirited del Potro. But nothing could stop Federer, who won 51 of the last 65 points and finished with 38 winners to a mere nine unforced errors.
Everything was working for Federer, and his mix of speeds and spins was masterful. One service game in the first set summed it up - ace, backhand winner, forehand winner, volley winner, all in less than two minutes. As he served for the second set, a fan shouted: "You're perfect, Roger!"
Not quite, but very, very good.
"For me, it's a fabulous effort," he said. "I'm delighted and hope I can keep it up."
Del Potro called it a bad day that showed he needs to improve to compete against the best.
"I can't do nothing in the match," del Potro said. "He play like No. 1 of the world."
The heat was slowly rising but wasn't a major issue in the opening match, when Vera Zvonareva ran off 11 straight games in a 6-3, 6-0 win over 2007 Wimbledon finalist Marion Bartoli of France to reach the semifinals for the first time in 25 majors.
Seventh-ranked Zvonareva will meet fellow Russian Dinara Safina, who survived 11 double-faults and 36 unforced errors to beat Australia's Jelena Dokic 6-4, 4-6, 6-4 in a match with 11 service breaks. It's the second straight Grand Slam semifinal for Safina - younger sister of 2005 men's champion Marat Safin - who lost to eventual champion Serena Williams at the U.S. Open.
Dokic's loss ended one of the tournament's most compelling stories: The former Wimbledon semifinalist was making her return to a Grand Slam after a three-year absence due to personal problems.
Safina apologized to the crowd for beating the local favorite, who advanced through a wild-card play tournament and was ranked No. 187.
"I hope that next time you'll be behind me," she said.
Dokic was happy with her performance.
"There's nothing to be disappointed about," Dokic said. "It's been a great start to 2009. I couldn't have asked for anything more."
The Australian Open has turned into a struggle for survival: Djokovic was the fourth player to quit in mid-match in two days.
"Obviously, it's very disappointing way to finish my first Grand Slam of the year," he said. "But you have to take the best out of it and be positive. There is still a long season in front of me."
Djokovic also retired in his quarterfinal against Rafael Nadal with a back problem at the 2006 French Open and his semifinal against the Spaniard at Wimbledon in 2007.
Roddick dropped only two points in five service games in the second set, getting the first break of the match for a 4-3 edge.
Meanwhile, Djokovic was wilting in the heat, draping towels packed with ice around his neck during changeovers. Clearly laboring, he lost his serve in the first game of the third set, double-faulting twice.
He managed to break back in the second game with a perfect lob. Djokovic held in the next game but looked increasingly weary and shrugged toward his coach. A cold towel around his shoulders again after the game, he called for the trainer, who massaged his thighs with ice.
"I was kind of just playing my side of the court and I didn't notice until the umpire said that they had someone coming out to see him," Roddick said. "I feel bad for Novak right now. He worked so hard for this last year. To not get a fair chance to defend his title, that's too bad."
By contrast, Roddick - who grew up in Texas and Florida and has said he loves the heat - looked fresh until the end.