I'm looking for the title and author of a novel (series?) I read sometime in the late 2000s.
It was an alternate-world fantasy, but one heavily based on imperial Russia. The main (or maybe only?) form of magic is necromancy - specifically the control over the ghosts of dead people. To see and control the ghosts, necromancers have to take mind-enhancing drugs of their own devising. Most people find necromancy repugnant and it is strictly forbidden, with very few necromancers around.
The main plot involves a young (noble?) boy who teaches himself necromancy. He's found out and has to flee the country, but he eventually comes back and uses his knowledge to help combat an evil necromancer (a Rasputin-like character).
A key plot point is that ghosts only form from people who die tragically or are otherwise clinging to life. There's a scene where a woman condemned to die by the evil necromancer removes her clothes in the ice and snow and willingly dies of hypothermia, rather than resisting death and becoming a ghost that the evil necromancer can exploit.