DESPITE THEIR ancientness and proximity, Jerusalem and Cairo have never had much in common. In fact, until fairly recently it was impossible to travel directly between the estranged capitals of Israel and Egypt, nearly any journey from one to the other requiring a stop in a third country.

After Israel's withdrawl from the Sinai under the Camp David agreements in 1982, however, Israeli-Egyptian border restrictions were relaxed. There now are several ways to go between Jerusalem or Tel Aviv and Cairo: By air, by taxi--or, for the high-spirited, adventurous and impecunious, bus.

The bus route between Jerusalem-Tel Aviv and Cairo has now been in operation for a little over a year. It is Israel's first and only international bus line and what one Israeli official has called "one of the few good results of the peace."

One Tuesday morning at six o'clock, a handful of passengers, myself included, boarded a bus at Jerusalem's central bus station. We were armed with assurances from Egged, the Israeli bus line, that Cairo-bound buses were air conditioned for the trip across the desert and were always given quick passage through the Israeli-Egyptian border crossing.

Most of us were motivated to take the trip, I suspect, by a chance to get a look at the Sinai--whose magical name evokes the mystery of the distant past, the Bible and the turmoil of recent history--or by a cheap ($25) way to get to Cairo.

After the paying customers had taken their seats, Israeli soldiers of both sexes, many packing automatic rifles, streamed aboard, filling the aisle. Leaving the holy city behind, we set off on a rolling cross-country ride on back roads that clearly did not lie on the direct route to Cairo.

After a journey of an hour or two through orchards and farmland, with the soldiers dropped off along the way, the bus pulled into a station in the coastal city of Ashkelon. There the driver, as surly a gentleman as I have seen in public service, turned in his seat and shouted at the top of his lungs, "It is finished." He threw open the door and disappeared.

We climbed down and waited. After a half hour or so, a big Mercedes touring bus pulled into the terminal. On board was Sylvia, an Israeli army reservist, our official guide. She promptly ordered us up the steps, and we soon learned that this was the main bus from Tel Aviv. The first bus from Jerusalem was only a local connection.

Naturally, we now thought we had it made. And we did--for about 30 miles. It was a lovely trip while it lasted, through the agricultural lands along the coast of southwestern Israel, a region resembling parts of northern Italy, and into the barren Gaza strip. The bus skirted the town of Gaza itself because of security problems, Sylvia said.

It was nine a.m. when the bus arrived at Rafah, the Israeli-Egyptian frontier in the northern Sinai. The desert air had already reached 100 degrees Fahrenheit. As the bus rolled to a stop in front of the gate, Sylvia started shouting at us, "Off the bus, now, now, now." One passenger timidly raised his hand and asked, "Will we be getting back on this bus." Sylvia didn't bother to respond. "Off, off, off," she said. Politeness, we were learning, was not a useful commodity on this trip.

As we climbed down from the air-conditioned bus into the searing heat, Israeli soldiers directed us through the gate into the Egyptian passport control area. Soon we would miss even Sylvia, who at the first opportunity had taken her bus and fled. Inside the open-air compound--dusty, shadeless and without water or restroom facilities--were long lines of local Arabs, who regularly cross the border to work on one side or the other. Direction signs were in Arabic; no one spoke English.

I had met a pleasant Canadian woman on the bus, and we decided to plunge into one of the lines without benefit of instruction. Our bad luck. After 20 minutes of pushing and shoving, we arrived at a window. The official there looked at our passports and started shouting in Arabic. He stood up and left. An old Bedouin woman rescued us, pointing toward another line. There we were required to change American dollars into Egyptian pounds. Israeli scheckels were not accepted.

So it went--false starts, retraced steps, disappearing officials and at least five lines to change money, obtain receipts, have visas cleared, luggage inspected and pay the border fee of two Egyptian pounds (about $2.80).

Three-and-a-half hours later the group from the bus emerged intact from the compound. What we found was nothing--no bus, no guide, no officials, no instructions. We stood there abandoned. The Sinai stretched into eternity before us. Some of us laughed. One young woman who identified herself in a British accent as "Pam" dropped down on her backpack and declared, "I'm not moving until somebody who knows what they're doing shows up." Fat chance, I thought.

At last out of the desert, a young man appeared. He politely identified himself as our Egyptian guide, and showed us to a bus waiting beyond a row of taxis. It had been there all along.

The ride along the narrow ribbon of asphalt that skirts the southern coast of the Mediterranean soon made me and the other passengers forget the border. Bedouin tents--most these days fitted with antennae to pick up Israeli television--are pitched in gullies and wadis too barren to support vegetation. Boys lead camels over corniced dunes of rolling sand. Women in black carry loads on their heads.

Along the coast west of El Arish, a coastal town that was once a border checkpoint, palm trees line glorious beaches unspoiled by a single sunbather. The Mediterranean is deep blue. It is an area the Egyptian government plans to develop for tourism one day. But now it is still virgin territory.

As the road draws away from the sea, the desert becomes total. Bedouin tents are scattered in enclaves, and several tiny villages are strung along the road. Pure Lawrence of Arabia.

The road soon narrowed to the width of the bus, and the driver, a fat garrulous Egyptian named Ahmed, delighted in running the few oncoming cars off the asphalt. After each victory, he gave the thumbs-up sign. Sand drifts covered sections of the highway. We arrived in the middle of nowhere. The bus stopped.

Ahmed climbed out and opened a luggage compartment. Back he came with bottles of water for sale at one pound ($1.40) per liter. If you're going to sell water, I thought, this is the place to do it. After purchases by most of the passengers, the entepreneur-driver started the bus up again.

By now the desert was endless, and the trip seemed eternal. Even the Bedouin had disappeared. Yet off in the distance, if you squinted, there was a ship, then another one, in fact a string of ships.

After several more miles and a car or two left struggling in the sand, the bus bounced over one last dune. Before us was the bluest, straightest, most welcome stretch of water imaginable. In contrast to the desert that it bisects for about l00 miles, the Suez Canal looked like a lake on the moon. It was the most profound and startling moment of the trip.

The crossing at El Qantara was routine. The bus pulled into a waiting line of cars, a flatbed ferry slid into the dock, and we drove aboard. The crossing was about 400 yards and 10 minutes.

After the Sinai and the canal, the rest of the trip was anticlimactic. The passengers were old desert hands now. It was still three hours to Cairo, but the trip down to Ismailia and across the Eastern Desert was ordinary. The adventure was over.

It was rush hour as the bus wheeled through Heliopolis, a sprawling Cairo suburb of broad, hot avenues. Despite Ahmed's peculiar driving talents, the bus soon was caught up in an immense traffic jam. There was no movement for half an hour. Men in gallabiyas began running across the tops of stranded vehicles just to cross the street. At last there were sirens, motorcycles and police cars, and President Hosni Mubarak's long black limousine flashed by, the final installment of a motorcade.

A cheer went up among the passengers. It was not for Mubarak, but because the bus was rolling again. Some had not been to a restroom since leaving Ashkelon nearly 12 hours earlier. The toilet on board was out of order. There was one pit stop outside Ismailia, but the women on board declared their facilities too filthy to use. A few of us, my Canadian friend and I included, had decided to travel dehydrated for just this possibility.

Traffic in Cairo was formidable, but Ahmed nonetheless made the rounds and dropped off all passengers at their hotels. The Nile Hilton, my stop, was last. It was nearly 9 p.m. when I walked into the lobby--15 hours and another world from the beginning of the journey in Jerusalem. Stella, the local beer, came in huge 22-ounce bottles, a good thing.

I took the plane back to Israel a week later. But that's another story.