The Pentagon's new five-year plan for protecting Mideast oil fields calls for spending millions on a network of bases within reach of the Persian Gulf, including one in Anwar Sadat's Egypt.

American forces, according to internal Pentagon documents, would have access to Egypt's Ras Banas, a finger of land poking into the Red Sea, which separates Egypt from oil-rich Saudi Arabia.

The United States, the documents reveal, intends to improve Ras Banas as well as bases in Oman, Kenya and the island of Diego Garcia to provide launching pads for American military power in the volatile Indian Ocean theater.

The idea is to be able to respond to a crisis quickly before it gets out of hand, presumably deterring the Soviets from committing forces to the trouble spot.

But taking on a fireman's role in the Mideast carries the risk that American blood will be spilled in distant countries -- a risk that the Pentagon civilian hierarchy addresses in its latest budget directives to the military services.

To handle possible casualties of the new rapid deployment force, the Navy has been directed to earmark money for hospital ships in drawing up its budget for fiscal 1982 through 1986.

"Fund in the minimum three 250-bed and one 500-bed Selected Reserve fleet hospitals and the conversation of the SS United States to a hospital ship," states the Pentagon's budget guidance to the Navy in discussing rapid deployment force programs.

Reflecting the sense of urgency about this part of its preparation, Pentagon leaders direct the Navy to finish its planning for hospital ships by next June 30.

A desire to speed up the planned improvement of military bases in reach of the Persian Gulf stands out from the highly technical program decision memorandum bearing the signature of Defense Secretary Harold Brown.

After looking over the Navy's tentative budget for fiscal 1982 through 1986, Brown directed that more money go for improving facilities at Oman's island of Al Masirah.

Also, directed Brown, the Navy should increase the amount it had earmarked for upgrading military facilities in Kenya.

The United States has negotiated access rights for its military forces to existing facilities in Egypt, Oman and Kenya. In exchange or the right to use those countries' facilities, the United States has agreed to spend millions to improve them.

However, the U.S. government has promised to keep its military in low profile rather than return to the post-World War II practices of building and operating giant bases overseas.

An exception to this low-profile rule is the British-owned island of Diego Garcia. The Carter administration is turning that tiny island in the Indian Ocean into a bastion of American military power -- with the cost expected to total $1 billion.

Internal Pentagon papers confirm that plans include widening the runways of Diego Garcia so they can accommodate the long-range, eight-engined B52 bombers -- the only really long-reach bomber the United States possesses.

In a memo, one of Brown's deputies directs the Air Force to "fund the previously approved Diego Garcia upgrade program and fund planning and design in fiscal year 1982 for an auster B52 support capability."

In contrast to the gingerly way leaders in Oman and Kenya have put out the welcome mat to U.S. military forces, Egyptian President Sadat has openly issued warm invitations. One of the new budget guidance papers directs the Air Force to improve Egypt's air base at Ras Banas.

In an interview in May with Washington Post Co. Chairman Katharine Graham and Newsweek, Sadat said he had asked U.S. officials: "Why not train my people and put your planes here? Whenever you choose to come, send your crew instead of long logistic lines of communications."

He has recommended that the United States pre-position weaponry, but not troops, in Egypt, arms that could be brought to bear rapidly in a Mideast crisis. "I am not asking for American bases or American soldiers. No, no. I can raise a million-soldier army . . . Send me war gear."

U.S. access to Egypt's Ras Banas is expecially significant to the American military in light of Saudi Arabia's opposition to such a presence on its territory.

As another part of the U.S. effort to improve its response capability, the Pentagon's budget directive tells the Air Force to carry through plans for upgrading air fields at Lajes in the Azores, way stations for planes going to Europe and the Mideast.