On the day he lost the 1967 Democratic primary to incumbent Rep. Robert C. Nix (D-Pa.), the Rev. William H. Gray III, a Philadelphia Baptist minister, started his 1978 campaign.

And on the day he beat Nix in the 1978 primary -- assuring his election in the overwhelmingly Democratic district -- he launched another campaign that has landed him two key committee assignments in the House and earned him the reputation of one of the stars in the Class of 1978.

In the freshman class top-heavy with experienced state legislators, three of whom had been state House speakers, Gray was elected by freshman Democrats as their representative to the Democratic Steering and Policy Committee, the leadership group that makes committee assignments and sets party policy.

With that as a springboard, and with the endorsement of the Congressional Black Caucus, Gray then won a spot on the House Budget Committee, where the first fight over President Carter's new budget will occur.

Leadership aides have marked Gray, 37, a soft-spoken graduate of the Princeton Theological Seminary, as a "comer, a hustler."

Said Parren Mitchel (D-Md.), chairman of the Black Caucus, "He's top flight."

Some of the enthusiasm is simply a result of the contrast between Gray and Nix, a lethargic product of the Philadelphia machine, who managed to remain anonymous despite the fact that he served for 20 years in the House and rose to become chairman of the House Post Office and Civil Service Committee.

But it is also a result of the political sophistication Gray has shown, though he has never held public office. Gray says his immersion in community affairs and the church was not all that bad a background. "Baptist churches are not quite what most people think," he said.

After winning last year's primary. Gray sought advice from members of the Black Caucus, the Pennsylvania delegation and his old friend, Andrew Young, Carter's ambassador to the United Nations, who had stumped for Gray in the primary fight with Nix.

Gray said he spent three to four weeks in Washington, talking with the leadership.

Their advice was to work closely with the leadership. There are few openings in the leadership for a new member, but the Steering and Policy Committee is one. Service there puts a member in close contact with the leadership, and, because it functions as the committee on committees, earns credits from colleagues.

On the Friday before the freshman orientation classes began, Gray began to seek out his fellow freshmen and campaign for the spot against four others. Gray told his colleagues his "greatest strength is that I wasn't an elected official before. Therefore I would come to this post unbiased and unfettered." He promised he would be "first and foremost an advocate for them regardless of their ideological position and I would not be biased by a conservative, moderate or liberal label. I also promised I would not be an active candidate for any committee any other person wanted."

Gray continued to win in the bottom-man-out balloting and finally defeated Rep. Claude Leach (D-La.) in a runoff.

Being on the Steering and Policy Committee almost guaranteed Gray his first committee choice, Budget. In addition, the Black Caucus had petitioned the leadership to ensure that two blacks would serve on that committee.

Some 20 members sought Budget Committee seats, 14 of them senior members, six freshmen. But because it is a temporary assignment of six years, few of the freshmen made it their first choice.

Gray did. His primary interest is housing, since his district contains 50 percent abandoned and vacated housing and Gray ran a nonprofit housing corporation there.

But Gray reasoned there would be no purpose in serving on the Banking Committee, which controls housing, if the budget did not contain funds for housing programs. "They can't do a thing if the Budget Committee doesn't give them the money," Gray said.

When it came time to vote in the Steering and Policy Committee on filling Budget Committee vacancies, Gray touted the other five freshmen who wanted the seat. He said nothing on his own behalf. But he didn't have to. Members were aware of the leadership commitment to the Black Caucus and from association with him they were familiar with Gray's preference. He won. So did freshman Rep. Bill Nelson (D-Fla.).

Though Banking was his second choice, Gray supported fellow freshman Mike Lowry (D-Wash.) for the spot, first to keep his promise to his colleagues and then because Lowry had helped Gray build the coalition of freshmen that elected him to Steering and Policy.

Gray took the International Relations Committee instead. "It doesn't affect my district much, but I figure I have a friend on Banking, if I need one," said the savvy newcomer.