Fontana also went on to work on the animated series, and she penned the classic 1973 episode "Yesteryear," in which Spock travels back in time to rescue a younger version of himself.

In 1987, Fontana helped launch a new era of Star Trek when she co-wrote "Encounter at Farpoint," the two-part pilot for Star Trek: The Next Generation, which introduced the world to Patrick Stewart's Captain Picard and earned a Hugo nomination, which she shared with co-writer and Star Trek creator Gene Roddenberry.

"She was a pioneer. Her work will continue to influence for generations to come," William Shatner said Tuesday via Twitter.

Fontana wrote under the name "D.C." to help prevent discrimination based on her gender when submitting pitches around Hollywood. She already was a working writer who had sold a few scripts when she first met Roddenberry, who at the time was overseeing the NBC military series The Lieutenant. In 1963, Fontana was working as a production secretary to one of the producers of The Lieutenant, and she ended up reporting directly to Roddenberry when his secretary was hospitalized for two months.

Soon after, Roddenberry brought her along to Star Trek to work as his production secretary and asked her to choose a story to write for season one. "Charlie X," an episode about the Enterprise picking up an unstable teen boy with powerful mental abilities, would become her first sci-fi credit and would make her a rare breed at the time: a woman who wrote sci-fi TV stories.

"At the time, I wasn't especially aware there were so few female writers doing action adventure scripts," Fontana recalled in 2013. "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."

She also contributed to Star Trek: Deep Space Nine, and worked on the web series Star Trek: New Voyages. In addition to Star Trek, Fontana's credit included such shows as The Waltons, Bonanza and The Six Million Dollar Man, among others.

In recent years, she worked as a lecturer in the Screenwriting department at the American Film Institute Conservatory. At the end of her writing classes, Fontana would often pose a single question to her MFA students and invite them to respond verbally or follow-up with an answer after class. The question was "Why write?" Many students found this to be critical to their education and self-development.

Fontana was nominated for a WGA Award for co-writing an episode of the 1969-70 NBC series Then Came Bronson. The WGA honored her with the Morgan Cox Award in 1997 and and 2002.

She is survived by her husband, Oscar-winning visual effects artist Dennis Skotak.

Trilby Beresford contributed to this report.

Dec. 3, 1:02 p.m. A previous version misspelled the name of Spock's father, Sarek.