Mr. Roddenberry recognized her ambition, and her record of writing for Westerns, and asked her to pick which story she wanted to write from the production outline for Season One. Her first script, about the ship’s encounter with a mysterious human teenager who possesses strange powers, became the second episode of “Star Trek.”
Ms. Fontana wrote for all three seasons of the original series. She later wrote for other science fiction shows, including “Star Trek: Deep Space Nine,” “The Six Million Dollar Man,” and “Babylon 5,” as well as influential shows outside that genre, including “Dallas,” “The Waltons” and “Bonanza.”
In her later years, Ms. Fontana taught at the American Film Institute. She is survived by her husband, Mr. Skotak, a special effects designer, who said she continued to teach at the film institute until just a few weeks before her death.
“She was a very, very tough lady,” Mr. Skotak said. “She carried a phaser with her right up to the end.”
Speaking to StarTrek.com in 2013, Ms. Fontana reflected on what it was like to be a female writer in Hollywood in the 1960s. While working on “Star Trek,” she said, she did not realize that she had gone where no woman had gone before.
“At the time, I wasn’t especially aware there were so few female writers doing action adventure scripts,” she said. “There were plenty doing soaps, comedies, or on variety shows. By choosing to do action adventure, I was in an elite, very talented and very different group of women writers.”