“If my books had been any worse, I would not have been invited to Hollywood, and if they had been any better, I would not have come,” Raymond Chandler once quipped. Chandler, of course, is the creator of Phillip Marlowe and the writer of The Big Sleep and The Long Goodbye. He may be the greatest detective writer ever. Kem Nunn knows Chandler’s observation well; he quoted it to me when I met up with him in San Diego right after Christmas. Nunn’s brooding but slyly comedic novel Chance, about a psychiatrist in San Francisco who falls for the wrong woman, is just out now.

Chandler couldn’t stand Hollywood (he wrote in 1945 that screenwriters “devote their entire time to work which has no more possibility of distinction than a Pekinese has of becoming a Great Dane”), but Nunn, who is often cited as the heir to Chandler and the other legendary hard-boiled California writers, does well by it. It’s an indication not just of the sea change between the old studio system and its more malleable current incarnation, but also Nunn’s talent that he’s managed to make Hollywood work for him and not vice versa. Sure, he has to show up on set every day (he writes for FX’s Sons of Anarchy, where he’s also an executive producer, and has written for HBO’s Deadwood and the late lamented John from Cincinatti) but “I’ve always bankrolled my novel habit with Hollywood,” he says. “It’s given me freedom.”Nunn_cover

If he had a career based solely on publishing novels, Nunn would probably find it harder to break out of the “surf noir” tag that has stuck to his work. He’d be beholden to making a living giving readers more of what they’ve already read by him. Only three of his six novels are surf-set, but his language about the sport in those books is seductive; his characters’ nostalgia for a life lived close to the water and sand is rueful, not facile; and he creates violent, suspenseful plots that suck you in. He will probably never wrestle himself out from under the surf noir designation.

But Chance might change, or at least complicate, that shorthand. The novel isn’t purely a psychological thriller, literary novel, medical mystery or fatalistic love story. It’s all of those things. “Everything is fair game in pursuit of a voice that’s your own,” Nunn says. “The tropes of any particular genre are up for grabs.” Nunn compels you to care about a character who is aware that he is “in the midst of some profound disintegration,” as Nunn writes, and seems to be doing everything he can to stupidly get hunted by the ruthless, vindictive ex-husband of the woman he loves. Hollywood has allowed Nunn the freedom to write about what he wants to, and it’s a delight watching him run with it in Chance.