CAPE CANAVERAL, Fla. - How do you get rid of the body of a dead astronaut on a three-year mission to Mars and back?

When should the plug be pulled on a critically ill astronaut who is using up precious oxygen and endangering the rest of the crew? Should NASA employ DNA testing to weed out astronauts who might get a disease on a long flight?

With NASA planning to land on Mars in 30 years, and with the recent discovery of the most "Earthlike" planet ever seen outside the solar system, the space agency has begun to ponder some of the thorny practical and ethical questions posed by deep space exploration.

Some of these who-gets-thrown-from-the-lifeboat questions are outlined in a NASA document on crew health obtained by the Associated Press through a Freedom of Information Act request.

NASA doctors and scientists, with help from outside bioethicists and medical experts, hope to answer many of these questions in the next several years.

"As you can imagine, it's a thing that people aren't really comfortable talking about," said Richard Williams, NASA's chief health and medical officer. "We're trying to develop the ethical framework to equip commanders and mission managers to make some of those difficult decisions should they arrive."

One topic that is evidently too hot to handle: How do you cope with sexual desire among healthy men and women during a mission years long?

Sex is not mentioned in the document and has long been almost a taboo topic at NASA. Williams said sex in space was not a matter of crew health but a behavioral issue that would have to be taken up by others at NASA.

The agency will have to address the matter sooner or later, said Paul Root Wolpe, a bioethicist at the University of Pennsylvania who has advised NASA since 2001.

"There is a decision that is going to have to be made about mixed-sex crews," he said, "and there is going to be a lot of debate about it."

The document does spell out some health policies in detail, such as how much radiation astronauts can be exposed to from space travel and the number of hours crew members should work each week.

But on other topics - such as steps for disposing of the dead and cutting off an astronaut's medical care if he or she cannot survive - the document merely says a policy is needed.

"There may come a time in which a significant risk of death has to be weighed against mission success," Wolpe said. "The idea that we will always choose a person's well-being over mission success, it sounds good, but it doesn't really turn out to be necessarily the way decisions always will be made."

For now, astronauts who become critically sick or injured at the International Space Station - something that has never happened - can leave the orbiting outpost 220 miles above Earth and return home within hours aboard a Russian Soyuz vehicle.

That wouldn't be possible if a life-and-death situation were to arise on a voyage to Mars, where the nearest hospital is millions of miles away.

And astronauts going to the moon and Mars for long periods must contend with the basic health risks from space travel, multiplied many times over: radiation, the loss of muscle and bone, and the psychological challenges of isolation.