Sam accompanies the Prometheus on a flight as it passes near a gas cloud she wants to study. When an unidentified alien ship attacks and they need to activate the hyperdrive, Sam suffers a major concussion - when she wakes up, the ship is abandoned and floating in the gas cloud. As she tries to fight against unconsciousness and coma, she is haunted by visions of Teal'c (who advises caution), Daniel (who wants her to keep exploring and investigating things), and a young girl who appears to be a younger version of herself. Realizing they're fragments of her subconscious mind, Sam tries to heed their somewhat contradictory advice while trying to get the Prometheus out of the cloud, which is slowly dissolving the hull.
Sam also comes to realize that she is dealing with her own loneliness not only aboard the ship but in her life, as visions of her father Jacob and Jack come to her and "discuss" matters with her. Eventually Sam figures out a way to protect the ship by generating a hyperdrive bubble around the ship, but realizes the attacking alien ship is stranded in the cloud as well. She offers to help them out in return for the captive Prometheus crew which they have as prisoners - they make no verbal response but signify their agreement by sending the crew over. Sam helps them and they depart, and then she finally collapses from her head wound. She wakes up to find Jack watching over her, as she decides to do with him and her love life.