The Complaints by Ian Rankin

Ian Rankin's new detective is a worthy successor to the much-missed Rebus

The Complaints is the second Ian Rankin novel since John Rebus retired in Exit Music, and readers who are still suffering from Rebus deprivation are likely to be heartened by the arrival of a cop who shows every sign of being as eminently suitable as his successor. The two men have little in common except integrity and a dogged determination to get the job done. Inspector Malcolm Fox is teetotal in a hard-drinking world, a cop who wears unfashionable braces without embarrassment because they are the most effective way of holding up his trousers, who is described by a boss as "a bear of a man", slow but steady, and only occasionally to be feared.

Fox works in the Complaints & Conduct department of the force, colloquially known as "the complaints", in the section dedicated to the sniffing out of the most serious offences – racism and corruption. This he does with honesty and persistence, accepting that to work in "the complaints" is to be a pariah to your colleagues. Now he has the satisfaction of a notable success. For 11 years in the CID, Glen Heaton has been bending the rules to his advantage, but Fox and his team have at last been able to compile sufficient evidence against him and the procurator fiscal has accepted the case.

Fox's private life is less successful. He is paying for his aged father in an expensive care home. The cost is a heavy drain on his salary but he makes no complaints and visits regularly, while worrying whether the old man might not have been happier living with him. His only sister is being abused by her partner. He should be able to deal with Vince Faulkner, but how can you help a woman who lies to defend her attacker because she loves him?

And now, with Heaton exposed, Fox is given an additional task. A cop, Jamie Breck, is suspected of being a member of a paedophile ring, but so far nothing can be proved. Fox is assigned to forge a relationship with Breck in an attempt to obtain the necessary evidence. The two men are very different. Jamie Breck asserts that he can influence every moment of his life; Fox feels that he is always at the mercy of powerful forces beyond his control. Initial suspicion develops into respect and then friendship. Can this man really be a paedophile, and if not, why the surveillance? Was even their friendship foreseen and planned for a purpose? Are both of them being set up to be professionally destroyed? But by whom, and why? The mystery is complicated by a brutal and sadistic murder which is too close to home for Fox to stand aside from, particularly as his sister is being questioned as a suspect. How far is the murder part of the plot?

The setting, as with the Rebus stories, is Edinburgh, which combines something of the claustrophobic intimacy of a village with the splendours and hidden miseries of a great international city. But now it is in the grasp of the recession; half-built tower blocks soar against a winter sky, shopfronts are shuttered. The poor and vulnerable suffer most, but there are powerful people who have exploited the greedy years of huge profits and are now facing financial disaster, men with the means and influence to call on even a psychopathic killer to ensure that whatever is necessary to their survival will be done. Fox and Breck are in danger of losing more than their jobs and reputation.

Rankin is predominantly a crime novelist of realism. He eschews even the convenient convention that a detective does not age and may talk of retiring but seldom does. Each book is set unambiguously in place and time. In The Complaints we are given precise dates at which the narrative moves forward. The story is told chiefly in dialogue which is terse and realistic. We meet Malcolm Fox on Friday 6 February 2009, and part company on Tuesday 24 February. We travel with him through the sinister underground of the city and the haunts of the rich and powerful, knowing the pubs, the offices, the hotels he enters, what he eats when he is alone, where he does his shopping and the food he buys. And always human lives are seen against the thread of history.

Rankin is a master at what, for me, is one of the important aspects of a crime novel: the integration of setting, plot, characters and a theme which, for Rankin, is the moral dimension never far from his writing. Here it is unambiguously stated on the cover of The Complaints: who decides right from wrong? Fox is so fully realised and interesting a character, his job in "the complaints" so fraught with fascinating possibilities, that we can surely hope to meet him again. And somewhere in Edinburgh is John Rebus, retired, but for Ian Rankin readers very much alive.

PD James's latest novel is The Private Patient, published by Faber