María Dolz, the first-person narrator of Javier Marías’s razor-sharp new novel, The Infatuations, warns, “It’s very risky imagining yourself into someone else’s mind, it’s sometimes hard to leave, I suppose that’s why so few people do it and why almost everyone avoids it.” Despite her warning, María (like Marías) spends most of her time contemplating “borrowed thoughts,” effectively imaging her way into the minds of those, both living and dead, who make up her world.

Every day, María breakfasts at the same Madrid café, where she sits happily and watches the Perfect Couple from a distance, who also breakfasts daily at the same café, before she goes to the publishing house where she works as an editor to contend with inept and entitled authors alike: “They were the brief, modest spectacle that lifted my mood before I went to work at the publishing house to wrestle with my megalomaniac boss and his horrible authors.”

The ridiculous authors provide some comic relief in this thrilling and, at times, dark novel. A lonely novelist named Cortezo calls María for sartorial advice, asking, for example, “Do you think a pair of argyle socks would go with these fine-pinstripe trousers and a pair of brown tasselled moccasins?”

Another author, the absurdly pompous Garay Fontina, calls her demanding, “I need you to get me a couple of grams of cocaine for a scene in my new book. Have someone come over to my house as soon as possible, or, at any rate, before it gets dark. I want to see what colour cocaine is in daylight, so that I don’t get it wrong.” María tells Fontina that she does not need to procure the drugs to tell him the colour of cocaine: “I can assure you that cocaine is white, both in daylight and under artificial lighting, almost everyone knows that.” Despite his over-the-top request, María must treat Fontina diplomatically, for his novels sell and he is rumoured to be in the running for the Nobel Prize, a rumour he starts, propagates and attempts, with some success, to imbue with reality himself (he even prepares an acceptance speech “in Swedish!” so as to impress King Carl XVI Gustaf). María’s boss is a fan: “He took his most conceited author far too seriously; it never ceases to amaze me how these vain people manage to persuade so many others of their worth; it’s one of the world’s great enigmas.”

The Infatuations is only peripherally concerned with narcissistic authors, however. At the heart of the novel is the bloody murder of Miguel Desvern (or “Deverne,” María is never quite sure of the spelling), one half of the Perfect Couple. In June, the Perfect Couple stop coming to the café, but María assumes that they are on vacation, though she is nevertheless disheartened by their absence and generally affected: “It made me less tolerant of weaknesses, vanities and stupidities.”

It is María’s colleague Beatriz, with whom she had discussed “that extraordinary pair,” who first mentions the murder of Miguel to her, wrongly assuming that she knew all about the gruesome incident. She informs María that Miguel had been murdered by a “madman,” a homeless man who makes money guiding cars to parking spots, “a gorilla,” and who, in a fit of rage and insanity, “had stabbed and stabbed and stabbed him with one of those apparently illegal butterfly knives.” But it was a case of mistaken identity, María learns; the madman wrongly believed that Miguel had lured his daughters into prostitution.

María quickly realizes that she was one of the last people to see Miguel alive and, like his wife, she is left grappling with the senselessness of his murder: “The incident occurred on the last day that I saw him there, which is how I know that his wife and I had said goodbye to him at the same time, she with her lips and I with my eyes only. In a further cruelly ironic touch, it was his birthday; he had thus died a year older than he had been the day before, at fifty.”

María sees Miguel’s wife again, the remaining half of the Perfect Couple, at the café “towards the tail-end of summer, late into September” – “She looked fragile, like a hesitant novice ghost, who is not yet fully convinced that she is one” – and she finally decides to befriend her.

María learns that her name is Luisa Alday and that she and her husband noticed María at the café every day, too; they even had a pet name for her: The Prudent Young Woman. After learning of the murder and meeting Luisa, María’s infatuation is spurred on. She is concerned with Luisa’s consciousness: “‘How many small eternities will she experience in which she will struggle to make time move on,’ I thought, ‘if such a thing is possible, which I doubt.’” She also finds herself imaging Miguel’s last thoughts incessantly and incisively, even though he had had little time for thought while under attack, losing consciousness immediately after being stabbed. Nevertheless, María, like Luisa, performs a sort of psychic postmortem.

Consciousness is very much centre stage in The Infatuations, namely, the ways in which one’s consciousness plays on the corporeal world – and the ways the consciousnesses of others play on one another – and vice versa.

After María starts an affair with Miguel’s best friend, Javier Díaz-Varela, first meeting him one night at Luisa’s home and then later running into him at Madrid’s Museum of Natural History, María and Díaz-Varela cogitate constantly over Miguel’s final thoughts as well as Luisa’s future thoughts. Although Luisa appears inconsolable, both María and Díaz-Varela believe she will recover sooner than she expects, for she is young and beautiful and full of life. “The world belongs so much to the living and so little to the dead,” María thinks, “that the former tend to think that the death of a loved one is something that has happened more to them than to the deceased, who is, after all, the person who has died.”

Like in Marías’s other novels (A Heart So White, for example, and the Your Face Tomorrow trilogy, his magnum opus) there is a sort of system of quotations that repeat, echoing and resonating like musical themes. Even the thoughts of characters recur in the thoughts and speech of other characters; there is a porousness to the consciousnesses Marías represents: sentences and souls intermingle and become entangled. Macbeth and The Three Musketeers are quoted from repeatedly in The Infatuations, and Balzac’s great novella Colonel Chabert reverberates some of the novel’s most haunting themes.

In addition to being psychologically penetrating, The Infatuations is a wonderful mystery, in which catastrophes are contingent and everything is mutable and, therefore, unpredictable. Marías keeps the reader guessing till the last page of this mesmerizing and vertiginous and, often, bone-chilling and hair-raising novel.

John Goldbach is the author of The Devil and the Detective and Selected Blackouts.