Fallout from Iran's actions were to an extent priced in by markets
Raonic originally suffered the injury in the semi-final at Delray Beach and was forced to forfeit the final against American Jack Sock. He then missed this month's Masters event at Indian Wells.
The 26-year-old returned to action in Miami on Friday with a win over Serbian Viktor Troicki but said his injury had flared up again.
"It is the same muscle in the hamstring it got progressively worse after my first round and after practising yesterday (Saturday), it was not possible to compete today without putting myself at significant risk," he told reporters.
Raonic was due to face American qualifier Jared Donaldson.
His exit means three of the top five players in the world have had to sit out Miami due to injury. World number one Andy Murray and number two Novak Djokovic pulled out before the tournament.
Raonic has struggled with injuries for several months and said he had not been 100 percent fully fit for a tournament since last year's Wimbledon where he reached the final, before losing to Andy Murray.
"It hasn't been fun the last seven months. I haven't played one tournament form start to finish healthy. My goal for this tournament was to at least finish it healthy."
After Wimbledon, Raonic was hampered by cramps at the U.S. Open and the same issue caused him to miss Canada's Davis Cup match with Chile in September.
A month later, he withdrew from the China Open before his scheduled semi-final due to an ankle injury and he had to pull out a semi-final at the Paris Masters in November with a quadriceps tear.
Looking ahead to the clay court season, Raonic said that he was not going to play again until he was fully fit.
"Right now the perspective is going to change a little bit. Obviously the goal through these tournaments being on hard courts and so forth was that I can come back as soon as I feel ready.
"I think that that perspective is going to change to come back when I feel like I'm 100 percent. So I think that will - so that could be - who knows how long? That could be in two weeks; that could be a little bit longer," he said.
Raonic said he has been looking at possible changes to his training routines to try and avoid further injury problems.
"We've been trying a lot of different things, how many days in a row I'll train to the kind of exercises I'll do and so forth.
"I've been able to get through practices and training sessions where you push and push I would say physically-wise they are harder than matches. But I think in matches you sort of take out any kind of caution and you just go out and compete.
"That's where the issues have been coming. I haven't been having issues of getting hurt in practices and so forth. It's about really finding maybe new methods and approaches just to keep myself or get myself as prepared to withstand any kind of strain on my body."
Fallout from Iran's actions were to an extent priced in by markets
DXB said in a statement that airport 'recovery will take some time' after there was flooding caused by rainwater on the runway
The 22-time Grand Slam title winner was returning to action for the first time after missing most of the 2023 season
For the company's founders, it was a way to give back to the community
Unlocking Holistic Health: Camp to address all acute and chronic issues
Pizza Di Rocco expands into new communities
World No 3 focused on winning in Stuttgart, Madrid or Rome to get a title on the surface under her belt
Roads were shut and stern warnings were issued as the country experienced extreme weather conditions