In 2008, the first of a series of serendipitous events led then struggling writer Wendy Wunder (no, not a pseudonym) to a new career in YA literature. “I had been trying to write this adult novel that was semiautobiographical,” she says. Wunder wrote while her daughter was in preschool and diligently applied for grant funding to finish. “But I was starting to think maybe I should do something else with my life.”

She decided to pursue one of her other passions—she enrolled in yoga teacher training in Boston, where she lives with her husband and daughter. “And there I met a woman, Alexandra Bullen, who was writing YA.” The two clicked immediately and Bullen introduced Wunder to her team at Alloy Entertainment, the book packagers behind The Sisterhood of the Traveling Pants and Gossip Girl who also produced Bullen’s first novel, Wish. “And after years of floundering and trying to break into the world of adult literary fiction, I found a home in YA,” Wunder says.

Combining a rich vein of ideas, stories, and fragments beginning from her college journals, Wunder started discussing possible projects with the Alloy team. “I had written a story about a dying kid in graduate school at Emerson. Once I pitched that idea it was clearly the best and we went from there,” said Wunder. The result was her novel, The Probability of Miracles (Razorbill, Dec.), about Cam, an 18-year-old battling terminal cancer whose mother takes her from Florida to the town of Promise, Maine, a place where miraculous events purportedly occur.

Asked if tailoring her voice to the YA audience proved difficult, Wunder replies, “Not in the least. I had realized that most of the protagonists in my fiction were YA ages and most of my stories were coming-of-age. And,” Wunder adds with a laugh, “I’m immature. I love movies about teens. They’re a total guilty pleasure. So it was a good fit.”

Finding the distinctive and winning voice of her sarcastic, no-nonsense heroine proved easy. “Voice always comes to me first,” says Wunder. “Voice and rhythm. I even named my daughter Cadence in honor of that.”

Not everything about writing her novel came easily, however. “I thought I was a really visual person but it turns out not at all,” Wunder says. “My first draft looked like a play. It had a lot of white space that needed to be filled in. My editor at Alloy, Joelle Hobeika, would write notes in the margins like, ‘Where are they while they talk? What are they doing?’ ”

The essential subject matter was potentially deeply depressing so Wunder sought to balance the potential tragedy with humor. “I did a little research on this kind of cancer [neuroblastoma], which I chose because it can be cured miraculously—especially in children. But mostly I hoped that using magical realism would keep me away from anything too sad.”

Once she had 10 chapters, Alloy shopped the manuscript and Razorbill proved the highest bidder. “I feel so lucky. In a way it was so old-timey, like Maxwell Perkins and Ernest Hemingway. They were so supportive and gave me such a long leash.” Wunder credits her editor, Jocelyn Davies, with helping to heighten the essential tension of the novel—whether Cam will live or die. “Though it’s a novel about cancer it’s really a book about life and what it means to live life to its fullest,” Wunder says. “And about keeping hope alive despite all circumstances.”

Wunder says she’s both gratified and a bit shy about the glowing reviews and buzz her book has attracted. “It’s all so new. I love that my friends and family are so proud of me.” She’s particularly enjoying the reaction and community of the blogosphere and Twitter. “Twitter is fun, although it completely feeds into my ADHD. It can be distracting but it tempers some of the loneliness and isolation of writing.” In particular, Wunder enjoys following Judy Blume—a childhood favorite and hero.

Wunder’s next novel for Razorbill has the working title of The Museum of Intangible Things. Wunder describes it as “Thelma and Louise for teenagers.” As for yoga, her local yoga studio closed just last week, so now rather than teaching, Wunder plans to focus on writing and her own practice. “Each feeds the other. And yoga helps me stay grounded and present.”