Joe Dunthorne's third novel begins midsentence and with a party in full swing. Ray Morris does the rounds, moving from small talk with guests to flirty banter with the hostess. Marie tells him that she and her husband, Lee, have an "arrangement" whereby they are both allowed to sleep with one other person each year. There are terms and conditions: It can't be a friend and it must happen outside London. Marie then makes Ray an offer he can't refuse and the pair go upstairs.

Their brief, drunken, amorous encounter proves to be no harmless bit of fun. Marie breaks the rules — Ray is a friend and they live in London — and consequently her husband's heart. Ray betrays the trust of his heavily pregnant wife, Garthene. Lee moves out while Marie moves on, finding a handsome new admirer. Ray is afforded a second chance but his blunder turns out to be the first of many. Soon they are piling up and jeopardizing his marriage and threatening his sanity.

Dunthorne's 2008 debut "Submarine" — set in the author's native south Wales — was an uproarious coming-of-age tale which followed a teenage boy as he tried to patch up his parents' marital woes and lose his virginity. "The Adulterants" is another wincingly good and brilliantly observed novel about relationships, this time narrated by the older and supposedly wiser Ray, a misguided, misanthropic tech journalist who doesn't grasp that he is spiraling out of control until it is too late.

After his rash bedroom antics he unwittingly falls afoul of the law during the 2011 London riots. Mistaken for a looter, he is tagged by the state, vilified by trolls and evicted from his home. Just when it seems things can't get worse, Ray suspects that Garthene has given up on him and is having an affair with a colleague.

By rights, we shouldn't warm to foolish, selfish sad-sack Ray, a man devoid of responsibility, hung up on his lack of success and bitter about the happiness of others. However, it is hard to resist his caustic commentary on the trials and tribulations of modern life, or his catalog of put-downs and comebacks, sharp repartee and witty descriptions, dry reflections and crushing judgments. "It's easy to get a standing ovation when the seats are so uncomfortable," he muses. Or on seeing people with laptops in coffee shops at work on final drafts and cuts: "all these thirty-somethings who still hadn't given up their dreams, it was disgusting."

When Ray's luck runs out we get a sea change in mood. Dunthorne downplays the scorn and the gags to enable his antihero to emerge as a tragic, self-deluded figure deserving of our sympathy. A novel that gets off to a faltering start tracking shallow lives and superficial feelings quickly tightens its grip, and its focus, and turns into a riveting read led by a character we care about and believe in.

Malcolm Forbes has written for the Times Literary Supplement, the Economist and the Daily Beast. He lives in Edinburgh, Scotland.

The Adulterants
By: Joe Dunthorne.
Publisher: Tin House, 236 pages, $19.95.