Dr. Loyal Davis, 86, the stepfather of first lady Nancy Reagan and a noted brain surgeon, died of congestive heart failure yesterday at Scottsdale Memorial Hospital in Scottsdale, Ariz.

Mrs. Reagan was at Dr. Davis's bedside when he died. The president telephoned her soon afterward to offer his condolences. Later, deputy White House press secretary Larry Speakes said that the president would fly to Phoenix today to attend a memorial service.

Dr. Davis, who won widespread recognition and awards for his prowess as a surgeon, served in both world wars and during World War II was credited with having developed a helmet to protect pilots from shrapnel wounds that became the prototype of the modern aviation helmet. He also perfected a treatment for high-altitude frost-bite injuries.

He was the first neurosurgeon in Chicago and retired in 1963 as chief of surgery at Northwestern University's medical school. In a 1980 interview, he described himself as a "a strict disciplinarian" who tried to influence his students "in every aspect of their lives."

"I would like to be remembered for any contributions I may have made to educating students in surgery," Dr. Davis said in the interview with the Bulletin of the American College of Surgeons.

His influence was particularly strong on Nancy Davis, his adopted daughter, who was born Anne Frances Robbins. She was the child of well-known stage actress Edith Luckett and a car salesman, Kenneth Robbins, who left his wife the same year. Dr. Davis married Miss Luckett, who quit the stage and moved to Chicago, when Nancy was 7 years old.

Throughout her life, Nancy Reagan has talked fondly of the influence of the doctor, saying once that to this day she chews every morsel of food 32 times, as he taught her to do. She often quoted him and spoke proudly of his many accomplishments.

When she was 14 she adopted the name of her stepfather and legally became Nancy Davis. In her official biography, published when her husband was governor of California, Mrs. Reagan listed Dr. Davis as her father. When a magazine writer pointed out that Who's Who listed her as an adopted child, Mrs. Reagan firmly told an aide: "I don't care what the book says. He is my father. In my mind, he is my father. I have no father except Loyal Davis."

Some believe that Dr. Davis, known for his strong, conservative views, also influenced Reagan in his conversion from Democratic liberalism to Republican conservatism. There is no direct evidence for this, however, and Reagan already was becoming more conservative at the time he met Nancy Davis.

The one direct instance of Dr. Davis's influence acknowledged by Reagan came early in his governorship, in 1967, when he consulted the surgeon -- among several others -- on his views about a pending abortion liberalization bill that Dr. Davis favored and which Reagan signed into law.

Dr. Davis was never reluctant to give his views. He spoke out against fee-splitting between surgeons and referring doctors and opposed unnecessary surgery.

He was a founder of the American Board of Surgery and the American Board of Neurological Surgery, a chairman of the board of regents and president of the American College of Surgeons, a president of the American Surgical Association and the Society of Neurological Surgeons and an editor of a texboook and a journal on surgical practices.

Born in Galesburg, Ill., on Jan. 17, 1896, Dr. Davis was the son of a railroad engineer. He worked his way through school, graduating from Knox College in Galesburg in 1914 and from Northwestern University's medical school in 1918. During World War II he served as senior Army consultant in neurological surgery from 1942 to 1944 in Europe and on a medical mission to Moscow to inspect field units.

Dr. Davis received honorary doctorates in science from Knox College and Temple University. In 1962, a surgical suite at Passavant Hospital, now part of Northwestern Memorial Hospital, was dedicated to him for his "leadership and accomplishments." In 1982, Northwestern established an endowed chair of surgery in honor of Dr. Davis and his wife. He was conferred honorary fellowships in the Royal Colleges of Surgeons in England, Scotland and Ireland.

Dr. Davis's wife, Edith, is confined to her home in Phoenix. In addition to Mrs. Davis and Mrs. Reagan, survivors include a son, Dr. Richard Davis, a neurosurgeon in Philadelphia, and four grandchildren.