My favorite writing of this was how Star Trek DS9 handled Nana Visitor's pregnancy. It felt out of character for her character (Kira Nerys) to get pregnant and it's the semi-utopian future, so presumably birth control works quite well and abortions are easily available. Solution: another female character gets pregnant, is injured in an emergency situation, and Kira agrees to act as surrogate. They effectively wrote this entire story line well enough, with implications for the dynamics between Kira and the biological parents, that I didn't realize until later that the actress was actually pregnant. I thought it was just an interesting plot line.