It's one thing to step onto a foreign world's surface; it's another matter entirely to set foot beneath its surface, trusting your safety to the structural integrity of a tunnel-like cave.

But that's precisely what humans will likely want to do if they ever intend to spend long periods of time on the moon or Mars. That's because staying below the surface would protect them from damaging radiation, likely more effectively than any terrestrial technology could. So, scientists practiced earlier this month here on Earth, at Lava Beds National Monument in California, to make sure future explorers can see exactly what they're getting into before they enter an extraterrestrial lava tube.

"It's a ton of fun; they're so different from one another," Kelsey Young, a geologist at NASA and principal investigator of the TubeX project to practice checking out terrestrial lava tubes to better prepare for exploration, told Space.com. Tubes can vary in how cluttered they are, their shape and size, what their entrances look like, and more. "There's never a tube that you get in that's exactly like one you've been in before," she said. [Astronauts Explore Caves in Mock Space Mission (Photos)]

Young's particular lava tubes were created by eruptions of the Medicine Lake Shield Volcano between 10,000 and 65,000 years ago, although volcanoes around the world have created similar features. The tubes form around rivers of lava because the flow's edges cool faster than its center. After an eruption ends, that outer shell lingers as a lava tube, often stretching for miles. And as thousands of years pass, patches of the ceiling fall in, creating easy entrances to the cave networks.

Lava Beds sports about 800 cave entrances, with some tunnels having multiple entrances. "It has such a high density of lava tubes in one place," Young said. "Some of them are enormous, like subway tunnel size," but others force scientists to crawl on their hands and knees.

Exactly the same process once played out on both the moon and Mars before each lost their volcanic activity. And people who want to establish a long-term human presence on those worlds are deeply interested in those extraterrestrial lava tubes as refuges from a key health risk of space travel: radiation.

Staying underground may be the most effective protection against radiation, and camping out in lava tubes would be much easier than creating new spaces under the surface. But exploring them without any knowledge in advance would be risky — hence practicing here on Earth to develop techniques that could allow astronauts to map those tubes from above the surface.

"You can't always tell just from the surface which way the tube is going to go," Young said. "Some of them can be quite sinuous, and these tubes are incredibly dark."

That's where a suite of carefully selected science instruments come into play. The team spent about a week at Lava Beds, their second visit of the project. They tested three types of portable technologies, evaluating whether they might allow future explorers to map lava tubes from the surface so they know what they're getting into in advance. Those portable instruments included a ground-penetrating radar, a magnetometer and a gravimeter.

"Obviously we had an inkling that those instruments would perform well or we wouldn't have lugged them out here," Young said. But she was pleased to see how well the trio worked together even just from initial data, with each instrument's strengths augmenting others' weaknesses to develop a detailed picture of each lava tube. "In general, these tools are incredibly powerful at giving you a real-time look at what you're standing on and what you're exploring."

On the moon or Mars, such an instrument suite could tell astronauts which tunnel entrances lead only to dead-ends and which open onto vast undergrounds spaces that could become living areas. Similarly, they can map out hazards like tricky entryways and floors covered with rubble.

In an environment where any injury would be a serious event, seeing inside lava tubes without stepping into them could be a hugely valuable tool for astronauts, safely revealing lunar or Martian secrets.

"Until you explore it, it's just a pit," Young said.

Email Meghan Bartels at mbartels@space.com or follow her @meghanbartels. Follow us @Spacedotcom, Facebook and Google+. Original article on Space.com.