IT is, says Chris Brookmyre, possibly the most compelling story he has written in a long time, and he may well be right.

Black Widow, his 18th novel since his scalding 1996 debut, Quite Ugly One Morning, is co-narrated in the first person by investigative journalist Jack Parlabane, a veteran of several Brookmyre books. The other narrator is Diane Jager, a formidably self-possessed surgeon who, under the pseudonym of Scalpelgirl – "part agony aunt and part firebrand polemicist" – has lately blogged about the misogyny endured by female medics, about the pressures put on them because they are women. Naturally, the blog put more than a few well-connected male noses out of joint.

Quiz: How well do you know your Brookmyre books? 

But then the blog went viral, Jager was outed as the author and duly punished online – "monstered", to use Brookmyre's expression. She lost her consultant post in north London but found a new one at Inverness Royal Infirmary, where she surprised herself by falling for, and marrying, a younger man, Peter, a hospital IT tech. As the book opens, however, Peter has been killed in a road accident, and Jager is on trial for murder.

It would spoil things to relate exactly how Parlabane, a top-notch reporter now much reduced in circumstances, comes into the story, but it is cleverly done. The book, which Brookmyre categorises as "domestic noir", is a captivating, layered, thought-provoking read.

"As always with my books, I can't remember where the spark [for Black Widow] came from," says Brookmyre. "So many things come into it, and I can't remember which one came first. Obviously, it's about a surgeon, but I was maybe more thinking that when my wife [Marisa] was going through her NHS career [as a consultant anaesthetist], I was conscious that a lot of her colleagues were young women who were giving the best years of their life to the job and were having trouble having lasting relationships because of the demands of the job.

"One of her colleagues was around 40 and was fearing she would never meet anyone in time to have a family; she met someone, though, got married, and they went on to have a baby. I was delighted that it worked out but as a crime writer you're thinking: what if that scenario didn't work out?

"There were other colleagues who would ask each other what they thought of someone's new guy – was she in denial about what he's really like, about his negative traits, because she's so desperate for this to work out? That fed into my mind: how much do we lie to ourselves when we desperately want a relationship to work out?

"How you might lie to yourself, but when you get married, that's when it all gets very real, and the question is: has the person you married changed?" Indeed, Jager, for all her professional steeliness, ponders aloud at one point that she fears she has become “a boring stick-in-the-mud who nobody wants to be around”.

As for that acerbic, outspoken "sexism in medicine" blog – how close to real life is it? Very, says Brookmyre. "Most of the instances of excesses of surgical behaviour [in the book] were actually based on things [Marisa] told me, down the years. Actually," he concedes with a laugh, "I took most of the really extreme ones out: the truths that she told me were far worse in terms of ludicrously infantile or bullying behaviour and abuses of power.

"There are power structures in an operating theatre. I'm sure it is gradually improving, but certainly the things that she or her colleagues were witness to, showed something that should never have been tolerated. It was a culture that tolerated it, but it was a very sexist culture as well.”

Barrhead-born Brookmyre, who lives with his wife and son in Bothwell, attracted considerable attention (not to mention the Critics' First Blood Award for Best First Crime Novel of theYear) for the fast-paced black comedy of his 1996 debut, Quite Ugly One Morning. It opened with a studiously detailed description of a doctor's mutilated corpse and almost simultaneously introduced us to Parlabane – spectacularly hungover and dressed only in a pair of boxers and a grubby T-shirt – who chances upon the body. The Herald didn't much care for the novel (it headlined its review, "Quite a nasty piece of work"), but its critic was decidedly in a minority: Brookmyre, with three unpublished novels behind him, had now arrived, and Scottish fiction had a vigorously imaginative new voice.

His many subsequent books have included One Fine Day In The Middle Of The Night and Boiling A Frog, as well as, more recently, a series about private investigator Jasmine Sharp. The Parlabane novels on their own have sold in excess of a million copies. Yet if you've followed Brookmyre's career over the last two decades you'll know that his writing has become more open – more, to use his own words, "morally complex". Black Widow, with its patient, thoughtful treatment of personal issues, and the exuberant Quite Ugly One Morning, are both linked by Parlabane, but what is striking is the assured shift in authorial tone, the widening path that Brookmyre has followed. Where his debut focuses gleefully on mayhem, Black Widow’s tone is such that when one of its characters makes a brief but touching reflection on what it means to lose one’s parents, it seems entirely in keeping with the rest of the book.

"I think there's been a natural maturing," says Brookmyre, whom the Times once dubbed "the enfant terrible of Scottish crime fiction".

"If I'm being flippant about it, I would say that I can't write the books I was writing 15-20 years now because I don't know everything any more. When I was younger I felt far more secure in my opinions about everything, and, of course, the more you learn, the more shades of grey creep into absolutely everything. Partly, I don't have the confidence to write in that way; but also, I suppose, what I find intriguing about characters has matured, too.

"In the past, it was big, broad-brush issues against a very dramatic backdrop of politics, and I suppose now it's more about the smaller betrayals, the smaller deceits. It's about the issues of deceit and trust in individual relationships rather than deceit-and-trust issues across, say, Westminster. I think that must be a natural thing: you are just going to ruminate more carefully about things.

"It's hard to distil it," he adds, "because it's been such a slow, gradual process. I mean, there are still wee moments when I can see where I can take a story into a slightly more whimsical direction, but with a book like Black Widow, I'm thinking, the tone of it is really important, and I don't want to do anything that is going to alleviate the tension. I want the reader to feel compelled by it.

"I realise that in the past, the books weren't as tight: they were far more about other things, so it didn't matter if you had a wee flight of fancy that made the reader laugh, because it wasn't all about the tension. I suppose there are always different ambitions what I'm trying to do with a book."

Years ago, Brookmyre, who is still only 47, worked as a sub-editor first with Screen International then with newspapers in Edinburgh. Parlabane remains a convincing fictional journalist, despite (or, depending on your point of view, because of) his underhand skills in hacking phones and all manner of “inventive illegality” in pursuit of a story. In Black Widow he shows remarkable guile and persistence to break wide open a story that has the potential to return him to his glory days. But in this post-Leveson age, and at a time when many newspapers are slashing budgets and staff numbers and have little time for someone with Parlabane's particular skills, he might seem like a piece of wishful thinking.

“Before I wrote Dead Girl Walking [the previous Parlabane story, in 2015] I read Nick Davies’s great book, Flat Earth News, which bemoaned the fact that there was no scope for someone to cultivate contacts, to have a long lead on a story," Brookmyre says. "It’s all about how much content can be generated in the shortest possible time. I suppose when your protagonist is a journalist you’ve got to try to put him in a situation where he can do his job but at the same time reflect that it’s not going to be the same job as it was 15 years ago.

“In the new book I’m in the latter stages of just now, he has moved on a bit and has got a job with a website that breaks news, or is one of those modern websites that is very good at pulling content from different media but is maybe missing someone who can go out there and find a story. There was always a bit of wish-fulfilment about Jack Parlabane, clearly even more so in the heyday of the print media, because I wanted to have someone who was a fun character who would do outlandish things to get to the story. I’ve tried to make him a bit more grounded in reality but the big issue is how he would actually make a living.”

I ask him about his taste for strong female characters, of whom Jager is merely the latest. “When you're a writer the great pleasure of what you can do is imagine what it’s like to be someone else, someone different, and a good starting-point is to write from a woman’s point of view in any given situation. I never found it easy to put myself in the mind of an alpha male or indeed a very laddish male, so maybe for some reason it comes naturally to me to have a more feminised perspective on things. I’ve tapped into that.

“I wrote the Jasmine Sharp trilogy from two different female perspectives and this Parlabane trilogy is half from the point of view of what is usually a morally complex female character. It’s satisfying from a creative point of view but it also allows me to explore the things that are far more pressing at the moment.

“Gender issues are more pertinent now than they have ever been. I think there’s a certain thematic consistency: Dead Girl Walking is about what it’s like to a woman rock star in the public eye, and I’ve taken that a degree forward in the case of Diane Jager being not just in the public eye but in a very masculine profession, too.”

Brookmyre, as restlessly industrious as ever, is currently on work on the novel he has already mentioned, but he has also agreed to deliver a science-fiction novel by next September. Well beyond that is a possible project in which he and Marisa are looking to collaborate; it is based on what he has referred to as an “amazing, untold story” that Marisa unearthed while researching the history of medicine for her Masters. So much has been uncovered that the project may stretch to several novels.

James Nesbitt once appeared in an ITV adaptation of a Parlabane story, but there has been nothing since. The rights to the Parlabane books are currently available; Brookmyre hopes Black Widow will kickstart interest, and it's at this point that he describes it as the most compelling story he has written in a long time.

The tone of the next novel is, he says, on a par with "the last two Parlabane books, but it probably has more humour in it. It's about cyber crime, but cyber-crime is largely about psychological manipulation. It doesn’t come down to skills with computer technology as to the ability to con people.

“We perceive hackers to be all about something technical but actually so much of hacking is what we call social engineering. It’s essentially some really clever con-tricks. It’s not about the code you’re keying in, it’s about getting someone to tell you their passwords. It’s as simple as that.”

He laughs. “My great ambition with this next book is that people will read it and change all their passwords. Because it’s amazing how much people will tell you with some simple social-engineering tricks. The more I read into it, the more paranoid I got myself.”

Black Widow is published this Thursday in hardback (£18.99) by Little, Brown www.brookmyre.co.uk