Martin Marietta Corp. yesterday beat out rival Rockwell International Corp. to win the largest single prize in the history of President Reagan's Strategic Defense Initiative program -- a five-year, $508 million contract to test and evaluate a simulated missile defense system.

Under the contract, Martin Marietta will design and operate a sophisticated facility outside Colorado Springs, Colo., that will serve as the computer "nerve center" for the entire SDI test program, according to industry experts. Electronically linked to a network of test sites around the country, the Martin Marietta facility is to use highly advanced Cray supercomputers and other state-of-the-art equipment to simulate various missile attack scenarios and test alternative ground- and space-based defense responses.

The contract, officially known as the "National Test Bed" award, moves Martin Marietta into the front ranks of SDI contractors, giving the Bethesda company a vital stake in the future of the controversial program. If SDI ever moves from its current research and development phase to deployment -- a decision considered to be at least five years away -- the contract could eventually be worth billions of dollars to the company.

"It leaves them in a central position in the program," said John Pike, a senior policy analyst with the Federation of American Scientists. "It's a big deal."

The most important element of the test bed contract is the advanced computer software, which will be designed by Martin Marietta's information and communications systems division in Denver, and will be used to test all aspects of the SDI program, ranging from missile simulations to battle management command, control and communications. By testing each part of the overall SDI design, the test bed will enable planners to compare and evaluate alternative proposals for a SDI defense before any actual hardware is constructed.

"The National Test Bed represents a quantum leap in the field of computer simulation," said Norman R. Augustine, chief executive officer of Martin Marietta. A company spokesman also noted that the computer software could eventually have a wide variety of research applications beyond military defenses.

About 1,500 people will be employed in Colorado Springs, according to the Air Force.

Martin Marietta and Rockwell were first selected to develop competing proposals for the test bed in July 1986. In preparing its plan, Martin Marietta assembled a team that included 10 other institutions that will work on the test bed as subcontractors to the company. The three largest subcontractors are Hughes Aircraft Co. in Los Angeles, International Business Machines Corp. in Houston and Geodynamics in Santa Barbara, Calif.