The Air Force failed in its first attempt to stop a missile with a beam of light, the Pentagon said yesterday.

The top-secret laser test took place Monday in the skies over the barren desert of China Lake weapons test center near California's Death Valley.

A modified version of the Boeing 707 passenger plane shot the beam of light at a Sidewinder missile in full flight. The Sidewinder is a missile pilots fire at enemy planes in dogfights.

The light generated by the gear aboard the military transport plane was supposed to zap the Sidewinder and bore into its innards, destroying the weapon.

But apparently the missile kept right on going, for reasons the Air Force does not yet understand.

Possibilities include failure of the laser gun to generate enough lethal light, or just a plain miss.

"The test failed and we don't know why," said Col. Bob O'Brien, spokesman for the Air Force Systems Command, which runs the airborne laser program.

An officer connected with the test program chose to accentuate the positive, declaring: "You learn by failures."

Soon after the Air Force figures out what went wrong, he said, the laser gun will be sent aloft for another try at stopping a missile.

Arguments have raged for years over how much effort should be spent on trying to generate laser beams powerful enough to destroy missiles and other weaponry in the resistant air near the surface of the earth. Laser beams are much more lethal in airless space.

If the Air Force manages to demonstrate that laser guns can indeed shoot down missiles, it could prompt the Pentagon to reorder its research priorities.

Currently, the laser is considered a gleam in some scientists' eyes, not a technology that should be pursued on a crash basis. A modest $80.8 million is earmarked in the fiscal 1982 Pentagon budget for the Air Force laser program, up from last year but far form a major investment for the Defense Department, which distributes money by the billion.

Laser enthusiasts envision the day when beams of light shot from laser guns in space will be able to disable incoming Soviet warheads. But the latest test indicates that it will take years to turn laser beams into destructive weapons. Light beams are already being used, however, to give bombs and artillery precise accuracy, a revolutionary development in itself.