The 28-year-old Serb broke his out-of-sorts opponent twice in the first set and three times in the second to wrap up victory in one hour 17 minutes on a blazing hot afternoon at the Indian Wells Tennis Garden in California.
Australian Open champion Djokovic improved his stellar record for the year to 22-1 as he tied Rafael Nadal with a record-equalling 27th ATP Masters 1000 crown.
Djokovic, who beat long-time rival Nadal 7-6(5) 6-2 in the semi-finals, also maintained his perfect record against Raonic as he won their sixth career meeting.
"Best match of the tournament for me today and probably the worst for Milos," Djokovic, an 11-time grand slam singles champion, told ESPN.
"He was not feeling his best and I wish him a speedy recovery.
"He just told me that he might have injured the same part of the leg as he did at the Australian Open, which took him off the tour for a month."
The Canadian was sidelined in February because of a groin injury that helped end his run in the semi-finals of the Australian Open, where he lost to Andy Murray in five sets.
"It's sad to have the finals like this in one way but I played a great tournament. I've got to be happy with what I've done from my side today," said Djokovic, who improved his career record at Indian Wells to 46-6.
"Every time he would miss the first serve, I was on top of the second serve. I was not allowing him to control the pace from the baseline, I moved him around the court. Tactically, I did everything right."
As courtside temperatures reached 94 degrees Fahrenheit (34C), Djokovic broke an erratic Raonic in the first and third games of the match as he breezed through the opening set in 43 minutes.
After leaving the court for medical treatment, Raonic returned for the second set and was broken again in the first game when he netted a backhand, and also in the third after he blasted a backhand long.
Clearly well short of his best form, Raonic saved two break points in the fifth before failing to hold and Djokovic comfortably sealed the win in the sixth when his opponent netted a forehand service return.