The 29-year-old Murray, who is yet to drop a set this week, sealed victory in one hour 31 minutes, his seventh successive win over fifth seed Ferrer.
The big-serving Raonic was forced to play twice on Friday, beating Tunisia's Malek Jaziri and Pablo Carreno Busta to advance to the last four and he sustained the injury during the win over the Spaniard.
"Yesterday during my second match in the evening, I rolled over my ankle, obviously caused it some level of a sprain," the Canadian told the ATP website.
'I don't enjoy tennis as much' - Murray admits comeback is proving tough
"I did a test this morning, which showed I had a partial tear on the outside of my ankle. I was told to give it a try. I tried to warm up just before the match like I would normally, and I was unable to play."
Murray, through to the China Open final for the first time, has enjoyed one of the best years of his career, winning Wimbledon and the Olympic gold medal. World number one Novak Djokovic pulled out of the tournament due to injury.
Britain's Johanna Konta had earlier reached the women's final.
'It's a no-brainer' - Murray urges players to support vaccine
Novak, put your money where your mouth is: Appearance fees have to end