Hundreds of parishioners and guests braved yesterday's bitter cold and jostled for pew space to hear the Rev. William H. Gray 3d deliver his farewell sermon as leader of Bright Hope Baptist Church in North Philadelphia.

Standing on the same pulpit from which the Rev. Dr. Martin Luther King Jr. once preached, the 65-year-old former congressman and head of the United Negro College Fund read a verse from Joshua. He used the transfer in leadership of the Israelites from Moses to Joshua as a metaphor for the passing of church leadership to Kevin Johnson, a former assistant minister at Abyssinian Baptist Church in Harlem.

Except, Gray joked, that unlike Moses, he hadn't yet died.

"We must grow and evolve into what God intended us to become," Gray shouted, his arms reaching toward the often cheering crowd. "Our new Joshua is well-trained and filled with the holy spirit. "

Gray, who sits on a number of corporate boards, said afterward that he planned to spend more time with his family. He said he would remain active with the church as pastor emeritus.

In his pastoral comments, successor Johnson, 32, promised Gray would still deliver the occasional sermon.

Under his 35-year tenure, Gray told the crowd, the Bright Hope parish grew from 1,500 to more than 3,000. Since 1985, Gray said, the church has served more than 1 million meals to the homeless and hungry, and hosted a stream of luminaries.

"Nelson Mandela, Bishop Tutu, even George Bush have been to this church," he said.

"He's never going to be replaced and we're not trying to replace him," said Elizabeth Washington, who has been a parishioner for 25 years and attended the sermon with her daughter and granddaughter, who was singing in the choir. She also knew Gray through politics: She was a 37th Ward committee person.

"God gave him a special gift," she said.

In 1979, Gray was elected to the House of Representatives and quickly rose through the ranks, becoming chairman of the budget committee and later majority whip, the most powerful congressional office ever held by an African American.

He left office in 1991 to head up the United Negro College Fund, where he raised more than $2.5 billion, including a $1 billion gift from the Bill and Melinda Gates Foundation in 1999.

Gray took over as pastor of Bright Hope from his father, who received a doctorate from the University of Pennsylvania in 1940 and had served as president of two black colleges. Gray's mother was dean of a black college. In the 1950s, the Gray family regularly hosted Martin Luther King.

Gray said that when he was in Philadelphia's Simon Gratz High School, his father was invited to speak as a successful black college president, but the principal, he said, admonished him not to bother speaking too long because "these kids aren't going anywhere. " He said his father stopped the principal to say that at least one of these kids was going somewhere.

In Congress, he said, he succeeded in opposing some of what he called oppressive fiscal policies of the Reagan administration. He said that as head of the budget committee, he got the first funding for fighting AIDS. He said he also persuaded Republicans in Congress to block President Reagan's constructive-engagement policy toward South Africa, which he said was nothing but support for apartheid, and to instead enforce sanctions.

Of all the facets of his career, he said, church pastor was the one that was closest to his core. "My dream growing up was to be a minister and eductor," he said.

"I am basically a preacher," he said, "doing the important job of comforting the sick, burying the dead, marrying the young, and dedicating babies. You are part of people's lives in a meaningful way. "

For the African American community, the spiritual, private and political worlds came together at Bright Hope, he said, calling it the "GHQ" - general headquarters - "for every significant issue we faced. "

While his voice still booms and he still looks vigorous, he said he believed in "passing the baton while you're still strong. "

"Don't wait till you can't lift your arm," he said.

After the sermon, parishioners lined up to hug him and say their goodbyes.

"He took us farther than anyone ever thought a boy from 16th and Oxford could," said Augusta Clark, a former city councilwoman who has known Gray since he was a teenager in the 1950s.

"He has always had a knack for connecting with the powerful," she said. "But he always kept the common touch. "