Murray has lost to Nadal and Djokovic on his previous two visits to Madrid
Britain's Andy Murray progressed to the third round of the Madrid Masters after his Italian opponent Simone Bolelli retired hurt early in the second set.
Bolelli, who had lost the first set 6-0 in under 30 minutes, appeared to sustain a shoulder injury when he attempted a smash shot to hold at 0-1.
The world number 43 tried to carry on but retired at 2-1 down in the second.
In other matches, Spanish world number one Rafael Nadal dropped a set before beating Ernests Gulbis 7-5 3-6 6-3.
Top seed Nadal, the 2005 champion, next faces Richard Gasquet after the Frenchman overcame 23 aces by American Mardy Fish to win 6-7 (7-3) 6-4 6-3.
Fourth seed Murray, who lost in the doubles playing with brother Jamie on Monday, will next face Marin Cilic.
Croatia's Cilic beat Spain's 13th seed Fernando Verdasco 6-2 6-3 in his second-round match and the 19-year-old will undoubtedly prove to be a tougher opponent than Bolelli, who was a late replacement for Marat Safin in the competition.
The Italian upset world number 17 Nicolas Almagro in the first round but it was soon apparent that the 23-year-old was a little out of his depth against Murray, who had received a bye in the first round.
Murray predicted a tough match against the Croatian, saying: "He's playing well on these courts.
"He's done well in big matches this year. It will be a tough match, I'll have to play very well to win. He's a danger here with the ball flying at altitude."
The Scot, 21, was playing competitively for the first time since last month's Davis Cup defeat by Austria and was featuring in his first ATP event since losing to Roger Federer in the US Open final early in September.
Murray seemed rejuvenated from his three-week break as his service game was almost flawless, with the British number one dropping just one point in the first set.
Bolelli made life difficult for himself with a host of unforced errors on his own serve, which Murray, showing some impressive defensive play, took advantage of by winning three of eight break points in the first set.
The man from Bologna eventually held his serve in the second game of the second set, but he seemed to injure himself in the process and conceded the match after 47 minutes of play.
Murray was pleased with his own performance, saying: "I was really happy with how I served and moved.
"There was a lot for me to take advantage of. He stopped for a shoulder problem, but he seemed to be hitting his serve fine to me."
Earlier, France's Gilles Simon defeated James Blake of the United States 3-6 6-1 6-4, while Blake's compatriot Robby Ginepri progressed with a 6-4 6-4 victory over France's Michael Llodra.