Such is the case of Dr. Marinus Bicknell Willett, the family physician of Charles Dexter Ward, and ultimately the hero of H.P. Lovecraft’s novella The Case of Charles Dexter Ward. (The image at right is of the late actor Frank Maxwell, who portrayed Dr. Willett in Roger Corman’s 1963 movie version of the story, The Haunted Palace (he took the title from an Edgar Allan Poe story, but the main inspiration for the film was definitely Lovecraft).
Wikipedia has more about the novella here, including this note on the good Dr. Willett:
An H. P. Lovecraft Encyclopedia compares Willett’s character to other “valiant counterweight[s]” in Lovecraft such as Thomas Malone in “The Horror at Red Hook” (1925) and Henry Armitage in “The Dunwich Horror“; like Willett, Armitage “defeats the ‘villains’ by incantations, and he is susceptible to the same flaws–pomposity, arrogance, self-importance–that can be seen in Willett.”