"Casting the Runes" is a very well-developed story, and it's also one of the most famous of James' tales. If someone has heard of a James story, this is quite likely to be it.
Mr. Dunning's character is a slightly different twist on the scholarly protagonist. He doesn't have noticeable faults, and he actually escapes the dreadful doom that is planned for him. Though he never talks about alchemy or anything scholarly, he is clearly a 'gentleman' in James' terms and he and his friend manage to figure out how to defeat Karswell.
Mr. Dunning has a pretty nice life, I must say. It sounds like MRJ's ideal life; nothing to do but poke around the library, investigating lovely antiquarian books. No idiotic young students to teach, just a quiet house with a couple of servants to do everything for you. Very nice.
Some think that Karswell's character was based on Aleister Crowley, but I don't know how likely that really is. Crowley was not yet very famous when this story was written, and there must have been quite a few cranks in England who invented their own religions and did black magic.
In 1959, Edward Gorey published a collection of "his favorite tales of ghosts, ghouls, and grisly goings-on" titled The Haunted Looking Glass. "Casting the Runes" was included in the book, and so this is the only James story I know of that has a Gorey illustration to go with it. I was just tickled to find this, because I think all the stories ought to have Gorey illustrations.
I was quite amused to find exactly the advertisement MRJ describes Mr. Dunning looking at in the train: "the brilliant and convincing dialogue
between Mr Lamplough and an eminent K.C. on the subject of Pyretic Saline." Here it is for you (or maybe it's just very similar, I'm not sure).