Sometimes, the stories that go on behind the historical scenes are just as fascinating, if not more so, than the well-known tales.

Novelist Philippa Gregory tells Steve Pratt why she found the story of Anne Boleyn's hidden sister so compelling and how it was brought to the small sceen.

Like many good stories, this was one that novelist Philippa Gregory stumbled across by accident. Researching a novel to be set in Tudor times, she read a reference to Henry VIII launching a ship named the Mary Boleyn.

She had, of course, heard of Anne Boleyn, who lost her head over the king, but not Mary. Further research revealed her to be Anne's sister and a leading player in a little-known story - she was the king's mistress before he married Anne.

Even more intriguing, the writer discovered that the sisters were used as "bait" in the Boleyn family's trap to acquire position and wealth in Henry's court. There was even a hint that Mary produced the son the king so dearly wanted.

Those are but the bare bones of an intriguing historical tale that Gregory, who lives in Hartlepool, turned into her novel The Other Boleyn Girl. Now her biggest-selling book to date has become a BBC2 film.

"It's a most extraordinary story with one sister being Henry's mistress, and the other coming in and taking over. Immediately, the novelist in my head goes, 'they're sisters and competing for the most glamorous man in Europe'," she explains.

"I suppose one reason everyone is interested in Henry VIII is because he had six wives. That's enough to be getting on with. There's this whole history that no one has been interested in, mainly because there's so much else going on with Henry.

"Sometimes I have my historical hat on, sometimes my novelist's hat. This is the time of the Reformation, but the human story is the competition between these two girls. It's a much more powerful and passionate story."

After The Other Boleyn Girl was published in 2001, she took it to producer Ruth Caleb, with whom she'd worked on a BBC adaptation of another of her novels A Respectable Trade, about the slave trade in Bristol. Caleb liked the new novel, asking for a one-page synopsis to show BBC bosses at a meeting to pitch ideas. She didn't get very far. Her presentation was interrupted and she was told the BBC wasn't making classical drama that wasn't from a classic novel. That ruled out a contemporary writer such as Gregory.

Caleb put the synopsis on the table and began pitching other ideas. "The head of drama read the outline off the table upside down and said, 'we have to go back to this'. It's a fantastic story, it must be for him to recognise that reading it upside down," says Gregory.

If the birth of the TV film was unusual, so was the approach. Gregory wanted to avoid the traditional approach to costume drama. "I didn't want it to look like a BBC Sunday evening historical drama, which I personally am very bored with," she says. "One of the ways I write as a novel is very immediate and very now. I don't use old-fashioned English. I do lots of research and hope the reader doesn't spot it. I just write it as a contemporary novel.

"So when we came to the film, we wanted to have something that felt much more contemporary. Ruth had done a lot of improvised films for the BBC and was very keen on the technique. I thought it was very risky, but that made it very interesting. And it's able to be done quickly with a small crew, and more cheaply. You lose lingering landscape shots and enormous set pieces, but what you do have is a very fast drama which feels quite urgent and exciting."

Natascha McElhone, currently to be seen opposite George Clooney in the movie Solaris, plays Mary Boleyn. Jodhi May is her famous sister Anne and Jared Harris, son of the late Richard Harris, a more youthful Henry VIII than we usually see. The impressive cast also includes Steven Mackintosh, Philip Glenister, Jack Shepherd and John Woodvine.

Actors spent four weeks in workshops improvising the script. Gregory was there a couple of days every week, mostly to help with the factual work. "They needed notes about their characters and background, things to flesh out their parts," she says. "There was a lot of anxiety about language, whether they should be speaking in fake Shakespearean dialogue, which I don't do in the novel. We caught most of the anachronisms, and the ones we didn't are a reasonable price to pay for a drama set in Tudor England."

Top TV adaptor Andrew Davies was brought in to shape the story. Gregory recognises the need to compress her novel and take liberties with the facts for dramatic purposes. As she points out, the main historical events are recorded but not what went on behind closed doors.

She's pleased with the result, and has every reason to be. The film achieves what she set out to do - make a piece of drama that grips and keeps you guessing until the end. You may know that Anne gets beheaded but Mary's fate is never certain.

This is the third of Gregory's novels to be seen as a film or series. Unlike some writers who seem unable to relinquish the task to others, she retains a healthy attitude to and distance from the film-making process. "What you learn about making a film is that it's not at all like making a novel," she says.

Two more books are currently in production as TV films - one set in the future, the other dealing with post-natal depression. Her subjects are diverse and very much what interests her at the time. She has resisted invitations to write an original screenplay. "My major work is writing novels, that's where I get most pleasure. Then it's interesting to see it transformed into another art form," she says.

Her next novel The Queen's Fool, being published in November, takes her back to Tudor times and the court of Queen Mary. She doesn't envisage a time when she runs out of historical tales. "There are extraordinary stories and hidden stories about women and the people who were close to major events, but not exactly key players. I don't think I'd write a novel about Anne Boleyn because she's been done. To write about her sister is a much more exciting thing to do."

Gregory moved to Hartlepool from Sussex three years ago to marry. Her training consultant husband comes from the North-East where, she feels, the quality of life is so much better. With a ten-year-old son, a daughter at university and four step-children, family life is busy so she's fairly disciplined about her writing. "I almost always start first thing in the morning and write during the day. I like to stop when my son comes home from school and spend time together," she says.

*The Other Boleyn Girl is on BBC2 on Friday at 9pm.