Gateway is a hollow asteroid, constructed by the Heechee, a long vanished alien race, as a spaceport. It was first discovered by an explorer on Venus, who found a small ship, fiddled with the controls and accidentally triggered its return (with him inside) to its home port, Gateway. Once there, he was unable to figure out how to get back, but before he committed suicide (he would have run out of supplies long before he could be rescued), he was able to signal Gateway's location to other humans.
The asteroid contains an irreplaceable treasure: nearly a thousand small starships abandoned there. Most still work, but using them is a dangerous gamble since the Heechee technology is so advanced, relative to Terran technology that the humans can only, with difficulty, decipher how the controls operate. The ships cannot be reverse engineered to find out how they are designed without destroying the guidance system. The controls for selecting a destination are eventually identified, but nobody knows where a particular setting will take the passengers or how long the trip will take. Once set, they cannot be changed in flight without fatal consequences. Most lead to useless places or into a situation fatal to the human explorers but a few lead to Heechee artifacts and habitable planets, and it is these which can make lucky explorers wealthy. Fortunately, the ships return automatically to Gateway. The vessels come in three standard sizes; Ones, Threes and Fives, of which some are armoured. After adding essential equipment and (hopefully) enough supplies, one, three or five people can cram themselves into the remaining space. Each ship is also equipped with a lander, to visit a planet or other object if one is found.
Robinette (Bob) Broadhead is a miner on Earth who wins a lottery which is just enough to purchase a one-way ticket to Gateway. Once there, he puts off going on a mission as long as he can, but eventually he starts running out of money. Although terrified, he goes out on three trips. The first draws a blank. The second's partial success is outweighed by the fact that he manages to destroy the ship in the process. On his third trip, the corporation that owns Gateway wants to try something different: sending two five-person ships, one slightly behind the other, to the same destination. Bob signs up, along with Gelle-Klara Moynlin, a woman he met on Gateway and fell in love with. When they reach the end of their journey, they find to their horror that they are in the gravitational grip of a black hole, without enough power to break free.
One of the others comes up with a desperate escape plan: link the two ships together, cram all the people into one of the pair, then blow up the attached landers. One ship will be thrown toward the black hole, allowing the other ship enough velocity to escape the black hole's gravity field. Working frantically to transfer unnecessary equipment to make room for everybody, Bob finds himself alone in the wrong ship when time runs out. He decides to sacrifice himself and closes the hatch. His ship is the one that gets away, leaving the rest of the crew stranded in the other, falling into the black hole.
He returns to Gateway and becomes wealthy when, as the sole "survivor", he gets paid for the entire group. He feels enormous survivor guilt for "deserting" his crewmates, especially Klara, so he seeks therapy from an Artificial Intelligence Freudian therapist program (which he names Sigfrid von Shrink). He finally comes to terms with his guilt despite the realization that, due to the gravitational time dilation resulting from their proximity to the black hole, time is passing much more slowly for his former crew mates and none of them have actually died yet.
The novel is divided between chapters of dialogue between Bob and Sigfrid, and chapters covering the main action. As a mark of Pohl's ingenuity the novel contains a few pages of the program that Sigfrid von S. is running when he is psychoanalyzing Broadhead, perhaps the only instance of a fictional computer language at the time of publication.