Mayor Marion Barry privately boasted after his reelection last November that he would take control of the District of Columbia's Democratic Party. But his quiet effort to force out party chairman Theodis R. (Ted) Gay appears to be failing.

Interviews last week with key members of the D.C. Democratic State Committee indicate that Gay will win a second term as chairman in June, short of a risky, all-out effort by Barry to dump him.

Gay, a low-key political technician who is active in national Democratic Party affairs, angered Barry last fall by discouraging the state committee from endorsing the mayor until after the Sept. 14 Democratic primary election.

Deputy Mayor Ivanhoe Donaldson, who served as Barry's campaign manager, chewed Gay out for his policy of neutrality. After the election, Barry told a member of the state committee that he intended to "take over" the local party organization and install a new chairman more to his liking.

But since then, Gay appears to have solidified his hold over the party while Barry has been unable to field a strong challenger. Attorney Robert B. Washington Jr., a former party chairman and occasional adviser to the mayor, briefly considered making the challenge but said last week he won't run under any circumstance.

"I'll be very Sherman-like about this," Washington said. "If nominated, I won't accept, if elected I won't serve. I just don't see a realistic set of circumstances to get me to run."

Lorraine H. Whitlock, one of the mayor's chief political allies in Ward 7 and a member of the state committee, said she, too, has no interest in Gay's job and is not aware of any concerted effort to defeat him.

"I don't know what they Barry and his supporters are going to do, because they're afraid of losing and Ted wants it badly," a high-ranking party official said recently. "They want a chairman totally responsive to the mayor and Ted has become very responsive, but they never forget."

In an interview last week, Barry declined to say whether he would back Gay or some other candidate when the state committee holds its election this spring. "I'll be ready by the time the state committee meets," said Barry, who supported Gay in 1981.

Gay last week attempted to minimize his differences with the mayor. He said he and Barry maintain a "fairly good working relationship," adding that, "I don't expect to get any opposition from him."

"I think he has always been very involved in the party," Gay said of Barry. "There's a fine line between involvement and control. I see the mayor and the party as being in unison right now."

Should Gay win a second term as chairman, it would represent a rare setback for the otherwise high-flying mayor. Barry emerged from the November general election as the city's preeminent political force, with firm control over a $1.9-billion budget, 35,000 city employes and a well-oiled campaign organization that reaches into practically every precinct.

Barry gradually has increased his influence over the local political structure, although more than half of the 66 members of the state committee are thought to be fairly independent of the mayor.

Donaldson, the mayor's top political adviser, recently denied that Barry is trying to take over the party to enhance his own political fortunes. Rather, Donaldson said, the mayor views the party as a vehicle by which he can "network out" to regional Democratic leaders and enlist support for District concerns on Capitol Hill.

Gay, 40, who runs an art framing shop, lacks the flamboyance and clout of previous party chairmen, including Washington; William Lucy, an official of the American Federation of State, County and Muncipal Employees; and civil rights lawyer Joseph Rauh. One of Gay's few detractors on the committee described him as a "very weak leader--a nuts-and-bolts person who lacks visibility."

But others argue that Gay's attention to the details of party organization and his success in reducing the party's debt from $35,000 to $9,000 are the very reasons he should be reelected.

They feel, too, that Gay is gaining stature through his work with the Democratic National Committee. He is a member of the national party's Compliance Review Commission and the Site Selection Committee that will decide where to hold the 1984 national convention. Last Thursday, Gay was elected vice president of the executive committee of the Association of State Democratic Chairs.

"I have the feeling that the party is getting better organized and that there is a clearer sense of the role of the party in the District and how it relates to the Democratic National Committee," said Walter E. Beach, the local treasurer.