Southern California lawyer William Dougherty says it began for him two years ago with a morning telephone call at home, a quick conversation with a man who said he was in trouble but refused to identify himself, and a hastily arranged meeting in the back corner of a Santa Ana bar called The Fling.

The man wore dark glasses and drank a Bloody Mary as they talked. "He never identified himself as anything but 'Jay,' " Dougherty said last week. "He seemed very, very wary . . . , told me how he went to the airport and they whisked him through customs, gave him a passport, and all that stuff. He told me about the man he described as The Minister, how they took him out to a dacha, they told him what they wanted, he went back and got it, and they gave him $10,000."

According to interviews with Dougherty and a lengthy affidavit on file in U.S. District Court in San Francisco, "Jay" told Dougherty that he was an international spy, supplying details about stolen documents and clandestine meetings in Mexico and Vienna. He talked about The Big Man, an American businessman he said had introduced him to his eastern contacts, and The Minister, a Polish intelligence officer who presented "Jay" with a list of secret documents and information desired by the Poles.

What "Jay" wanted now, Dougherty said he told him, was protection. He wanted immunity from prosecution, and in return he would tell all that he knew and would become a double agent for the United States. He wanted, as Dougherty put it, to "come in out of the cold."

Thus began the drawn-out climax of a transatlantic spy story that began unfolding publicly when James Durward Harper Jr., the man Dougherty says he knew as Jay, was arrested eight days ago on suspicion of selling national defense secrets to a foreign government.

Harper, a balding and slightly dumpy man blinking behind his glasses at the magistrate, was arraigned last Monday. On Nov. 10 he is to be officially charged with espionage in the sale of what a U.S. Army official called "extremely sensitive" documents describing Defense Department efforts to enable the Minuteman missile and other American nuclear weapons to survive a preemptive Soviet attack.

FBI agents took Harper into custody, reportedly without incident, in his apartment in Mountain View, one of the bedroom communities for the high-technology industry south of San Francisco. The apartment is part of a boxy stucco complex graced by a lone ailing geranium and a small concrete courtyard surrounding a miniature Venus de Milo statue.

The apartment has become, in its beaten-looking ordinariness, a small backdrop to the improbable cast that was introduced publicly for the first time last week in the 33-page FBI affidavit that accompanied the complaint against Harper.

There was a sad and generous blond secretary from Alabama, who drank vodka alone behind the closed door of her office and looked when she died of cirrhosis as though death had taken her weeks earlier. She was named as a source for many of the stolen documents.

There was a vigorous little businessman, charming and quick but thought by some to be faintly slippery in his dealings, who loved international travel. He was named as the contact who introduced Harper to the Poles.

There was the Polish intelligence officer, working as a member of the Polish Ministry of Machine Industry, who was named as having met Harper in bars and apartments and traded his documents for stacks of $100 bills.

There was a high-ranking source of information to U.S. intelligence, referred to only in the FBI affidavit as "the SOURCE."

And looming in the background, with its massive stores of information and its sudden eruptions of wealth for the occasional lucky entrepreneur, was the microchip and high-technology center known as Silicon Valley. It had drawn Harper, as surely as it had drawn the Alabama secretary and the charming businessman, with its promise of furious growth in an industry said to cater to the gifted, the creative, and the lover of risk.

When he was arrested, Harper was working as a consultant to a San Jose company that paid him $1,000 a week to design power supplies for personal computers. But for 20 years before that Harper had developed a reputation in Silicon Valley as a brilliant, erratic engineer with few real friends and two failed businesses behind him.

He grew up in north-central California, a first-string high school football halfback, a basketball player, naturally quick at math and science. He is reported to have enlisted in the Marines, where he was sent to electronics school, and later to have worked at a radar station in Alaska.

By the early 1960s, married to a woman he had known in school, Harper had settled in Silicon Valley and was forming a business called Harper Magnetics. He "had built a reputation of being absolutely brilliant in the field of high-voltage power supplies and transformers," a former business associate told an interviewer last week.

But Harper Magnetics folded soon after it started. Harper then worked for several different companies in the area, and in 1973 tried his own business again, this time with Harper Time and Electronics, which manufactured what has been called the world's first digital stopwatch.

By 1973, Harper had befriended a business associate named Neal Schuler and Schuler's wife, Ruby Louise. Louise Schuler, from Mobile, Ala., who disliked the name Ruby, had begun working as a secretary at a Palo Alto company called Systems Control Inc. in 1972.

Systems Control was described by one former high company official as "technological problem solvers." It designed the San Jose library system and the traffic control system for the Hong Kong Tunnel, the official said, and its work included defense contracts.

"Highly theoretical studies," said another former Systems Control executive who worked directly with Louise Schuler. "These were general studies that we did, and they might be along the lines of--given a particular radar, what is the best way we can use our radar to defend our missiles that are still in silos."

Louise Schuler had security clearance, which gave her access to "numerous kinds of classified reports," the executive said. It was not unlimited access, he said, because employes had combinations only to those safes that contained information they specifically needed.

"She had no understanding of what the material was," he said. "It was highly mathematical in nature."

Schuler was efficient, sometimes arriving at the office early or taking work home with her, apparently to complete it in time. She collected Wedgewood china, traveled every year to the Bing Crosby National Pro-Am golf tournament at Pebble Beach, Calif., and seemed to make friends easily. She was given to impulsive loans of $50 or $100 when a co-worker needed help.

"Louise was the woman everybody went to," one close friend said. "She took care of things. Just made you feel better."

She also was an alcoholic. Her friends knew it; even a company official who did not work full time with Schuler came to recognize the glazed look. It was drink, several friends think now, that helped tie Louise Schuler and James Harper after she had divorced her husband and he had divorced his wife.

"They hung out together--they were great drinking buddies," said the former Systems Control executive who came to know both of them quite well. "It was more like, what the hell, we're not doing anything this weekend, let's get married."

"Drinking buddies" is also the way some reports have described Harper's initial relationship with William Bell Hugle, who was a minor legend among micro-electronics executives in Silicon Valley.

Hugle had grown up in Cincinnati, according to a former friend and business associate who knew him very well, and studied science at the University of Chicago. His first wife, reportedly a gifted engineer, had come with Hugle to Silicon Valley and cofounded several electronics firms with him. She died in 1968, reportedly of cancer.

Hugle pressed on in the industry, known to his colleagues as a talented promoter who loved the hustle of fast-paced business, loved to drop names, and loved the pressure that came with international travel. He sometimes stalled en route to the airport, the associate said, just for the sprinting excitement of almost missing the plane.

"As long as I've known him, he's been an advocate of free trade, and by that I mean absolutely free worldwide," said Don Hoefler, who writes a newsletter called Microelectronic News and says he's an old friend of Hugle's. "He always felt technological transfer to the Soviet Union was foreordained, there was no way of avoiding it, so why restrict it?"

In 1975, Hugle International went bankrupt. Hugle, who had been chairman of the board at the company, spent most of the next five years living abroad, leaving behind a number of extremely unhappy investors.

In 1980, the Peninsula Times Tribune quoted Hugle as saying that his firm had been "contacted" by the Treasury Department for shipping certain equipment that ended up in Poland.

No charges were brought against Hugle. Federal bankruptcy records examined by local reporters indicate, however, that in 1974 Hugle received one payment of $648,000, allegedly for undelivered equipment, from a Polish business representative named Zdzislaw Przychodzien.

That is the person named in the FBI affidavit as The Minister, the Polish intelligence agent who allegedly arranged much of the purchase of documents from Harper. The affidavit said it was Hugle who introduced Harper and Przychodzien, and that at a 1979 meeting in Warsaw, the three men agreed that proceeds from the purchases would be divided equally among Harper, Hugle and Harper's sources for the documents.

Harper later learned that Przychodzien wanted to cut Hugle out of the deal, the affidavit said. By 1980, with Soviet intelligence officers reportedly highly excited about the offered documents, Harper allegedly was meeting with The Minister on his own.

"I took him the documents and we went to the villa again, just like before, and I gave him the documents," the affidavit quoted Harper as saying. "Some of the papers were kind of loose, I had a hell of a time putting it back together . . . . They just decided you didn't have to worry about the missing pages. I said, okay, fine. So I got this big envelope with $100,000 in it and proceeded to count it and got about a quarter of the way through it and said, oh, hell with it, it has to be here. I can eyeball it and it's all $100 bills."

Harper's taped recollection of this exchange was part of his unsuccessful effort to avoid prosecution. For two years, Dougherty said, the man he knew as "Jay" provided federal authorities with these details, usually contacting Dougherty by telephone and then meeting him in a northern or southern California airport.

Federal officials insisted that "Jay" identify himself, Dougherty said, and "Jay" refused to do that, even when Dougherty warned that federal agents were closing in on his identity.

"It seemed mainly he was doing it for the money and the adventure," said Dougherty, who has said his client is describing his activities in detail in an effort to cooperate with authorities. "He thought he was quite good at it . . . . He was always worried about getting arrested. He knew he'd committed the second most serious crime to murder."

Hugle has not been charged in the case. He was reported by numerous witnesses to have appeared before a federal grand jury last week. No one answers his telephone, and his whereabouts are unknown.

Louise Schuler died last June. A close friend said that when she entered the hospital for the last time she took a bottle of liquor with her.

"She never knew what he was doing," said one of the friends who watched Schuler's relationship with a husband who traveled abroad a great deal and had no evident source for so much income. Although the FBI has said Harper obtained documents through her from the firm where she worked, the friend said of Schuler, "She never knew where the money came from. She'd say, 'I don't want to know.' "