IT SOUNDS HARSH to say so, but short of losing another spacecraft, NASA's announcement that the space shuttle Discovery lost several chunks of foam insulation during its launch Tuesday was just about the worst thing that could happen to the space agency. For more than two years -- ever since a piece of foam fatally damaged the Columbia -- NASA scientists have focused intensely on fixing this one problem. Their failure to do so isn't a question of negligence, and it doesn't mean safety procedures have been ignored. It simply means they don't fully understand what causes the foam to fall off, or how to prevent it.

Given this failure, NASA's decision to ground the entire program indefinitely makes sense. But it also leaves the space agency and its congressional overseers with an agonizing dilemma. Without further shuttle flights, it will not be possible to finish construction of the international space station, a project into which American taxpayers have already sunk billions of dollars and which is almost finished. On the other hand, ending the shuttle program, which along with the space station consumes about 40 percent of NASA's budget, will free up funding for the next generation of manned spacecraft, the crew exploration vehicle, which is intended to be safer and more flexible, but smaller. It will not, for example, be able to carry the loads needed to complete the space station.

Because the stakes are so high, a decision to end the space shuttle program should not be taken lightly, and it cannot be made until more analysis can be done. But while Congress and NASA are pondering their options, they should keep the longer-term issues in mind, too. Putting human beings in space is, by definition, extraordinarily expensive and very dangerous. Unmanned space vehicles, by contrast, remain a relatively cost-effective way of gathering information about the universe. Before sinking billions of dollars into manned space missions to the moon or Mars, politicians should reflect hard on the price, in dollars and in lives, of what may someday be known as the space shuttle fiasco.