Lights of Zetar, The
The U.S.S. Enterprise's mission is to take Lieuenant Mira Romaine to Memory Alpha, the central library for the United Federation of Planets. There she will supervise the transfer of new equipment to the facility. Mr. Scott is immediately attracted to the pretty lieutenant, and the feelings are returned.
While in orbit, an energy storm destroys all the inhabitants of Memory Alpha, wiping its computer memory banks. As a result of the storm, Romaine can predict where the storm will strike next; the Enterprise.
Despite evasive tactics by the starship, the storm enters the Enterprise where it is seen as brilliantly flashing colored lights. The lights enter Lieutenant Romaine and there is no way to remove them without killing the officer. Perusal of her file reveals a high susceptibility to empathic transmissions, making her an excellent home for the lights. The lights turn out to be non-corporeal entities from the long-dead planet, Zetar. They maintain that they have the right to inhabit Romaine's body, but Kirk doesn't agree. When Mira is placed in a pressure chamber, the Zetars, who are used to the vacuum of space, die. Lieutenant Romaine is free and presumably returns to Memory Alpha to help rebuild the great library.