Ranek was a Lokirrim starship captain whose mission was to find and deactivate photonic insurgents. They were at war with photonic beings who had rebelled on their homeworld. When he encountered the Delta Flyer II with The Doctor aboard, he demanded that the ship surrender. In order to protect The Doctor, Seven of Nine downloaded his holo-program into her cortical implant. This allowed The Doctor to control her body and experience the full range of Human sensations. After boarding the ship, Ranek confiscated the mobile emitter, even though Seven/Doctor told him that it was a regeneration device.
While The Doctor controlled Seven, Ranek developed an attraction to her. In order to get the mobile emitter back, Seven used it to replicate food and drink, which she and Ranek consumed. He then returned the device to her. Ranek asked Seven of Nine to meet him on the bridge, and tried to set a romantic mood by showing her a pulsar cluster called the "Window of Dreams." He told Seven/Doctor that it was the most beautiful sight in the quadrant. Ranek kissed her and she pushed him away. Jaryn, the doctor on the ship, was in love with Ranek, but he did not know this until Seven informed him.
Ranek was severely injured during an attempt by the USS Voyager to rescue its crew members. The Doctor, released from within Seven's implants, was able to operate on Ranek and save his life. (VOY: "Body and Soul")