The Virginia Supreme Court ruled unanimously today that an unmarried woman who lives with a man may take the state bar examination because the living arrangement "bears no rational connection to her fitness to practice law."

The seven justices reversed a lower court ruling that prohibited federal government lawyer Bonnie C. Cord from taking the bar examination because she shares a home in Linden, Va., with Washington photographer Jeffery Blue.

Warren County Circuit Court Judge Duncan C. Gibb overruled last year a 2-to-1 recommendation by a committee of lawyers and refused to let Cord take the exam on grounds that the living arrangement "would lower the public's opinion of the bar as a whole."

Cord, 34, is a graduate of Georgetown University Law School and a member of the District of Columbia Bar. She works in the general counsel's office at the Federal Energy Regulatory Commission.

"I didn't know what to expect from the court because there just hadn't been any cases on the point," she said in a telephone interview after the decision was released. "I hope to take the bar exam in July if I can get my application filed in time."

Cord said she had not yet read the court's brief opinion and learned of the decision by calling the clerk's office in Richmond.

Chan Kendrick, executive director of the Virginia Chapter of the American Civil Liberties Union (ACLU), said he was "pleasantly surprised" by the unanimous decision even though the justices had peppered a state lawyer defending Gibb's rulling with critical questions during a February hearing on the case.

"I think we were lucky to have the 'rational connection' standard available in this case," he said. "I'm afraid it would have gone the other way if the issue had been equal protection, or sex discrimination or her right to privacy."

Such constitutional issues were raised unsuccessfully by the ACLU in another case decided today. In that case, the court upheld the constitionality of the state's law prohibiting solicitation of sexual acts by a homosexual.

Cord was represented by a private attorney, but the ACLU filed a brief in her behalf as a friend of the court.

During the February hearing, the justices questioned whether Gibb applied one standard of conduct to prosective lawyers and another for members of the bar and whether he had based his ruling solely on his personal views.

Cord's lawyer, Thomas V. Monahan of Winchester, Va., also contended his client was the victim of sex discrimination. He said that Virginia has never sought to block a man from taking the bar examination for deviating from moral standards and added, "There does appear to be an invidious approach taken in this case."

The court, however, sidestepped the discrimination issue and relied soley on a 1957 U.S. Supreme Court opinion holding that state imposed qualifications for lawyers must have "a rational connection with the applicant's fitness or capacity to practice law."

The state court's opinion pointed out that Gibb had found Cord to be qualified in every way, but barred her from taking the exam soley because he disapproved of her relationship with Blue.

"While Cord's living arrangement may be unorthodox and unacceptable to some segments of society," the court said, "this conduct bears no rational connection to he fitness to practice law. It cannot, therefore, serve to deny her the certificate" of good character needed to take the exam.