Svetlana Ogorodnikov, who is being tried on charges that she recruited an F.B.I. agent to spy for the Soviet Union, burst into tears in court today when another former F.B.I. agent testified that she had invited him to have sex.

''Why you lie - liar!'' Mrs. Ogorodnikov declared, interrupting the testimony of the former agent, John E. Hunt, who had been describing a dinner meeting he had with her in June 1982.

Mrs. Ogorodnikov is being tried with her husband, Nikolay, on charges that they conspired with Richard W. Miller, who was then an F.B.I. agent, to pass classified documents to the Soviet Union.

Mrs. Ogorodnikov, who is 34 years old, has contended in court papers that her activities with F.B.I. agents had been in connection with her role as an F.B.I. informer. She said she had had an affair with Mr. Hunt when he was assigned to her case, and later with Mr. Miller. The Government has denied that Mr. Hunt was involved in an intimate relationship with her.