Pan American World Airways announced yesterday it will buy 12 Lockheed L-1011-500 widebodied TriStar jets equipped with Rolls Royce engines to replace its aging Boeing 707s.

In addition to the initial order, whose price tag with spare parts is $500 million, Pan Am took options for 14 additional TriStars.

The Pan Am order is expected to have a significant impact on the L-1011 operations of Lockheed Corp., which has been losing money on the program, but not right away.

Lockheed Chairman Roy A. Anderson said the Pan Am order would not put the L-1011 production line on a profitable basis immediately because delivery of the planes won't start until 1980. "After that, it will have a significant impact on L-1011 operations," he said.

Six planes are scheduled for delivery to Pan Am in 1980 and six in 1981. Pan Am said the first passenger service with the new aircraft would begin in April 1980.

William T. Seawell, Pan Am's chairman and chief executive officer, said the flag carrier seriously considered buying more Boeing 747s or the McDonnell Douglas Corp's DC-10.

"The objective was to select the best economic fit for Pan Am's route systems and operations - the airplane that would give us the lowest cost and permit us to offer the lowest economic fares," he said. "Our studies showed that airplane to be the L-1011-500 with the Rolls Royce . . . engine." According to engineering and operating studies, the operating per mile costs of the chosen plane were significantly lower than the closest competition aircraft, he said.

Because the L-1011 is a more efficient plane and consumes considerably less fuel than the 707, Pan Am hopes to save millions of dollars in operating costs. It currently has 40 707s in its fleet.

Although the L-1011s have ordinarily used Rolls Royce engines, Pan Am did consider others as well before making its decision to stick with the Rolls Royce. Seawell noted that Rolls Royce and Pan Am had reached an agreement in principle for export Credit Guarantee Department financing of the entire purchase. The ECGD is the United Kingdom's equivalent to the U.S. Export-Import Bank.

Seawell made the aircraft purchase announcement after a meeting of the Pan Am board of directors in New York at which senior management officials outlined the merits of various aircraft and engines available.

The L-1011 Pan Am is ordering, which will have a longer range than the current L-1011s, is to be equipped with Lockheed's latest fuel-saving technology, including authomatically activated control surfaces and a computerized flight management system, according to Lockheed. Shorter than the basic L-1011, it will carry 24 seats in the first class cabin and 217 in economy for a total of 241.

The plane, which will have a nonstop range of 6,100 miles with a full load of passengers and baggage, has more range than the long-range 707 and is flexible enough to fly almost any route in Pan Am's current system, Seawell said.

Pan Am expects the plane to be used initially over its Latin American routes as well as selected Atlantic and U.S. domestic routes.

In addition to its 40 707 passenger jets, Pan Am's current fleet consists of 28 Boeing 747 passenger jets, six Boeing all-cargo 747s, 6 Boeing 747 Special Performance jets, three Boeing 707 cargo jets and 13 Boeing 727 passenger jets. Pan Am also has on order 4 additional 747 Special Performance jets.