It takes a certain audacity for a white male novelist to choose as his protagonist a young California woman who converts to Islam, disguises herself as a man in order to study in the tribal borderlands of Pakistan, and from there joins the Taliban in Afghanistan. You almost wonder if he’s spoiling for a fight of some kind. But the author of Godsend, John Wray (6ft 3in, softly spoken and unassuming), doesn’t seem the type. The most aggressive thing about him is the ghostly wailing of the doorbell of his brownstone near Prospect Park in Brooklyn (it’s on a “Halloween setting”). A Guggenheim and Whiting award winner, best known for Lowboy and The Lost Time Accidents, Wray was anointed one of Granta’s Best Young American Novelists in 2007. He has been living mostly in Mexico City for the past couple of years, but I caught him while he was in town to see his mother for the holidays.

The house, which he bought and fixed up several years ago when it “looked like there had been a fire”, has become a renowned haven for writers and artists, all gleaming wood and a David Bowie tribute bathroom. Friends are always in and out, often staying longer than expected, especially now that Wray is, in his late 40s, “at the age where people are getting divorced”. Current and former residents or renters of workspace there include Marlon James, Nathan Englander, Alice Sola Kim and Adrian Tomine.

In US culture now there’s a lot of attention, for very good reasons, on who has the right to tell a given story

As I talk to Wray, the novelist Akhil Sharma, who came to crash for a week or two, “and that was two years ago”, saunters upstairs, wearing Wray’s scarf. Wray asks if I want the football table that sits in the middle of the living room “like an enormous vase of flowers that cannot be moved” – an unsolicited gift from the Chilean writer Alejandro Zambra, who apparently decided the house was missing a touch of machismo. “People only play if they’re drunk,” he says. Noting affectionately that the crowd he has assembled here are “not just artists, they’re actually doing stuff that’s good”, he catches himself and laughs: “That’s a terrible thing to say.”

Still, it’s true that you can get away with a lot more if you’re good. Late on in the writing of Godsend, when Wray was starting to worry about publishing such a book “at this moment in US culture where there’s a lot of attention being brought to bear, for very good reasons, on who’s telling the story, what their agenda is, who should have the right to tell a given story”, he asked Hari Kunzru for advice.

“And he said: ‘You know, the real problem is not John Updike and Martin Amis, as privileged white men, writing about Islam. The problem was the books weren’t good.’ So, he just said: ‘Make it good. That’s the way to deal with that problem.’”

Wray agrees: Updike’s Terrorist seems “as though his mind was made up at the beginning … He thought he had all the answers. That’s usually a mistake. Even if you’re writing a novel about a divorce, it’s probably a good idea not to feel like you have all the answers going into it.”

With a delicate subject like this one, if you’re not pulling it off, Wray says, “you have to hope that someone close to you in your life will take you aside and say: ‘Listen, buddy, you’re really barking up the wrong tree here.’”

I’m sure people who worked on Homeland had the best intentions. And yet it was so Islamophobic

Facebook Twitter Pinterest Navid Negahban and Damian Lewis in Homeland. Photograph: Jim Bridges/Showtime

No one did, and the novel is a thrilling high-wire act – the experiences of its heroine, Aden Sawyer, renamed Suleyman, feel very real. Nonetheless, Wray was sensitive to the risk that he might inadvertently “contribute to the literature of misperception with regard to the Islamic world, with regard to aggressive views of the United States internationally, with regard to militant insurgencies, all the things that have been so cynically misrepresented in popular culture. I’m sure there are plenty of people who worked on Homeland who had the best intentions, who think of themselves as political progressives. And yet what they ended up producing was so self-serving and so Islamophobic and so juvenile in its treatment of a very complicated and nuanced issue.”

Godsend was sparked by an “arresting and fascinating fragment of a story” about a young female American Taliban fighter Wray heard in Afghanistan, during the weeks he spent doing research for a non-fiction project about John Walker Lindh, the US citizen captured while serving with the Taliban in 2001. When Lindh’s story hit the headlines, Wray recalls, “many Americans were like: ‘How is this even conceivable?’ And to me it seems perfectly understandable, why a young man would be drawn to the romance of this particular type of activism, which then took on a military element.”

Wray didn’t “feel confused or perturbed or perplexed or sort of conceptually out of my depth in any way” when thinking about Lindh’s story. “If you think about it, what could be more appealing to a teenager who’s grown up in comfortable upper-middle class circumstances, whose parents are separating, who’s suddenly at that age at which the entire adult world seems like really just a swamp of hypocrisy?” Whereas the American girl he kept hearing about in Aghanistan, whether or not she really existed – Wray suspects not – struck him as a more intriguingly mysterious prospect to write about, her motivation perhaps “a harder question to answer”.

In a sense, though, he feels he did answer it: “I definitely don’t judge people who become passionately involved in a political struggle, even to the point of taking up weapons in the service of that struggle, in the way that I would have before beginning the book.”

For him the interest was primarily psychological. “I’m sure there are very gifted writers who can begin with an idea – ‘I’m going to investigate capitalism, or I’m going to write a book that really confronts sexism in some way, so what would be a good situation for that?’” For Wray, though, “as soon as you have a point you’re trying to prove, you’re writing polemic.”

There are only a couple of moments in Godsend where Wray “came close to expressing a slightly more naked kind of political view, which I really tried not to do at all if I could avoid it – but of course, if you’re writing about a drone strike, you can’t avoid it.” He did feel that there would be some “possible value” in writing “a really vivid account of a drone strike from the point of view of the people who are being hit”, when so many accounts of the ethics of drone warfare are “from the point of view of the people who are sitting at the controls … It is kind of funny; I’ve read a number of articles about the psychological toll that being a drone operator takes on the men in those little bunkers in Arizona, and that’s fine. But perhaps the toll is slightly greater on the people who are on the receiving end.”

He remarks that American critics frequently noted the novel’s very brief, glancing treatment of the September 11 attacks – the only way he could think of to deal with that subject and “avoid cliche would be to talk about it almost as a kind of distant and borderline irrelevant rumour.”

Wray got a lot of use out of TE Lawrence’s Seven Pillars of Wisdom and was surprised that readers “brought up Yentl all the time, but they never brought up Lawrence of Arabia”. Nor did they mention Joan of Arc, one of the key figures he thought about when writing the book. He looked at other real-life examples, including two women who disguised themselves to fight in the American civil war, and is also interested in how often “that kind of legend seems to have popped up in various cultures”.

In fiction, unlikely is OK but implausible is not OK. I took it as a challenge not to exoticise anything

Despite the almost mythic element of Aden’s story, Wray needed it to have “an air of reality and authority” – “in fiction, unlikely is OK but implausible is not OK.” He took it as a challenge “not to present anyone in it as exotic, or the situation as exotic, not to exoticise anything”. His fixer on that first trip to Afghanistan unintentionally gave him an experience that proved useful later by dressing him in a kameez and skull cap to make him less conspicuous (hunching over to conceal his height also helped).

His experiences researching Godsend were the most alarming he’s had, although preparing for Lowboy, his acclaimed 2009 thriller tracing a day in the life of a teenager with paranoid schizophrenia, comes a close second. Lowboy’s protagonist, Will, who rides the New York subway on a quest for the girl who can take his virginity and thus help slow global warming, has stopped taking his medication and escaped the clinic where he was being held. For Wray, going into psychiatric hospitals and being “introduced to people as a med student” was “in a different way as stressful” as Afghanistan: he worried that maybe he “shouldn’t even be there”. He also wrote much of Lowboy while actually travelling on the New York subway, believing in the need “to make a project fun for yourself. I don’t particularly like working. So you try to turn it into a little adventure.” It may have yielded some extra insights here and there, but mainly allowed him “to not be in my house”.

When he does write in the Brooklyn house, it’s in the basement, which is full of musical instruments (as well as a ping-pong table), like “a throw-back” to the rehearsal space he lived in for a while in his mid-20s – “minus the rats”. Since giving up smoking, instead of cigarette breaks, “I’ll just nervously play the drums for a few minutes, and it works quite well as a substitute ’cos it’s that same kind of anxious energy. Much more expressive, much less carcinogenic.” Years ago, Wray “was in a bunch of mediocre bands” and also played now and then with Chan Marshall (AKA Cat Power), though he says writing was “the thing that I maybe felt I had a more realistic chance of doing well”.

Godsend by John Wray review – the girl who joins the Taliban Read more

His next project should be “less terrifying, more fun, I suppose”: it’s about three young people growing up in South Florida’s death metal scene. Wray wasn’t a metalhead, growing up in Buffalo, New York, “a rustbelt town” that was then “a pretty depressed place, and a pretty violent place”. Iron Maiden was “the dominant paradigm”, but he preferred the Smiths. He “had a bad time” at that age. “When I think about all the times that I drove when I was drunk when I was a teenager, just terrible, idiotic things that a fully developed brain would not have been on board with – there’s just this enormous pool of insufficiently risk-averse human beings, and that’s why we have standing armies, you know, that’s why we always find people willing to parachute into the jungle in Vietnam and set a village on fire.” Half-joking, he adds,“I’m scared of teenagers. It’s a very beautiful, very pure and very dangerous age, you know, it’s a fucked up age in many ways.” You get the sense that Wray could conjure pretty much any mind he wanted on the page – all the more intriguing, then, that Aden Sawyer’s turned out not to be quite the crazy leap it seemed.

• Godsend is published by Canongate. To order a copy for £10.99 (RRP £14.99) go to guardianbookshop.com or call 0330 333 6846. Free UK p&p over £15, online orders only. Phone orders min p&p of £1.99.