In this story, two male astronauts are on Mars and find a booth-like structure. One gets in and disappears. IIRC the second one follows him and is transported to a distant planet inhabited by intelligent, hostile reptiles. He gets back in and is transported again.
He visits and leaves a great variety of worlds, sometimes staying long, sometimes not; some have life, some don't. Eventually he realizes from the changing constellations that he is moving in a vast spiral across the Milky Way heading toward the core.