MERCED, Calif. — More than 5,000 parishioners packed the pews, the choir loft, and the vestibule on a recent weekend at Sacred Heart Church here in California’s Central Valley for five Masses — four of them in Spanish. Young Hispanic families spilled outside onto the steps, straining to hear the homily over the roar of an elevated freeway across the street.

Across the country in Philadelphia, there is only one weekend Mass now at Our Lady Help of Christians, a church built by and for German immigrants in 1898. The clock in its tower has stopped. The parochial school next door is closed. Only 53 worshippers, most of them with white hair, gathered for Mass on a recent Sunday in the soaring Gothic sanctuary.

The Roman Catholic Church that Pope Francis will encounter on his first visit to the United States is being buffeted by immense change, and it is struggling — with integrating a new generation of immigrants, with conflicts over buildings and resources, with recruiting priests, and with retaining congregants. The denomination is still the largest in the United States, but its power base is shifting.

On the East Coast and in the Midwest, bishops are closing or merging parishes and shuttering parochial schools built on the dimes and sweat of generations of European immigrants. In many parishes, worshippers are sparse, funerals outnumber baptisms, and Sunday collections are not enough to maintain even beloved houses of worship.

In the West and the South, and in some other unexpected pockets all over the country, the Church is bursting at the seams with immigrants, mostly from Mexico and Latin America, but also from Asia and Africa. Hispanic parents put their children on waiting lists for religious education classes and crowd into makeshift worship spaces, but avoid predominantly Anglo parishes because they do not always feel welcome there.

“The ethnic face of the Church is changing, and the center of gravity and influence in the Church is shifting from the East to the West, and from the North to the South,” Archbishop José H. Gómez of Los Angeles said.

He added: “Pope Francis knows all of this. He knows the face of the Church is changing, he knows the country’s Hispanic Catholic heritage, and he knows how important Hispanics are for the future of the Church.”

Yet the Church’s leadership in America has not kept pace. While more than one-third of the 68 million registered Catholics in the United States are Hispanic, just 28 out of 270 active bishops in the United States are, and only about 7.5 percent of priests identify as Hispanic or Latino, according to a report released last year.

The difficulties go beyond demographics.

The Catholic Church has lost members of all ages who say they have been alienated by the sexual abuse scandals, the exclusion of women and married men from the priesthood, the rejection of gay relationships and birth control, and the denial of Communion to Catholics who have divorced and remarried without an annulment.

Where two decades ago, about 1 of every 4 Americans identified as Catholic, today it is about 1 of every 5, part of a broader trend toward secularization. If ex-Catholics formed a church of their own, it would be the nation’s second largest, outranked by only the Catholic Church itself.

The challenge confronting Pope Francis this week as he visits Washington, New York, and Philadelphia — where he will give most of his addresses in Spanish — is how to reach these many faces of American Catholicism: the fervent and the fallen-away; the liberals and the traditionalists; the anxious, shrinking white working-class churches in some areas, and underserved largely immigrant churches in others.

* * * * *

Francis is, in many ways, the right man for the moment. He is the first pope from Latin America. He is a son of immigrants who carried their faith with them from Italy to Argentina — a living bridge between the old immigrant Church and the new.

And though Francis chose to visit the Church’s declining East, he is, in many ways, addressing Hispanics in the West — the Church’s future, and the nation’s — at a time when immigration and the change it brings are very live issues.

Two and a half years into his papacy, Francis is already much beloved. A new poll by The New York Times and CBS News shows that Francis is arriving in the United States on a wave of goodwill among American Catholics: 63 percent of those polled had a favorable opinion of him, far above the 43 percent peak for his predecessor, the retired Benedict XVI.

Pope-NYT-Poll

But there are divisions. A majority of Catholics in the Northeast, 53 percent, said the Church was out of touch with the needs of Catholics today, compared with 38 percent of Catholics in the West and 29 percent of Catholics in the South.

Francis, perhaps most importantly, has yet to create a shift in the dynamics of attendance and participation. When asked if their attendance at church had changed during the last two years, 13 percent said they were going to Mass more often, but 12 percent said they were going less, and 74 percent said nothing had changed.

* * * * *

The Diocese of Fresno is the fastest growing in the West, swelling with immigrants from Mexico, Central and South America, the Philippines, Laos, and Vietnam. Its size has more than doubled in 10 years, to 1.2 million members now from 581,000 in 2005, and Catholic leaders here say this is a vast undercount because many unauthorized immigrants, out of fear, never register as parish members.

But resources are scarce. Priests are aging and stretched thin. Even among the children and grandchildren of those faithful Hispanic immigrants, the Church is struggling to recruit clergy. One-fifth of American parishes have no resident priest at all, and many have a priest who is carrying on into his 70s or 80s.

When a priest died in February at age 76, the Rev. Dan Avila took over his parish, even though Avila already had a full-time job as the diocese’s vocations director, recruiting candidates for the priesthood and seeing them through seminary.

Currently 25 men are in the seminary, and three-fourths of them are Hispanic. But he has not seen any uptick in vocations since Francis became pope. The current class of seminarians, Avila said, “were heavily influenced by John Paul II.”

“They tend to be a little more conservative, a little more interested in the bells and whistles,” he continued. “I haven’t yet had guys saying that Pope Francis has really had an effect on them. The ripple effect takes a while.”

* * * * *

While the Diocese of Fresno is overwhelmed with worshippers, the Archdiocese of Philadelphia is desperate for them. It was once a Catholic powerhouse, rich in churches and schools, hospitals and donors, priests and congregants. Its archbishops have routinely received the red hat of a cardinal, with voting rights at papal conclaves.

But the heyday of the 1950s and ’60s — when most Catholics in Philadelphia attended Mass at least once a week — did not last. Families shrank and moved to the suburbs. More Catholic men and women chose the professions over religious life.

By the time Archbishop Charles J. Chaput was named to take over in Philadelphia four years ago, the archdiocese had hit a historical low. In the wake of another scathing grand jury report, four priests and a parochial school teacher were under indictment and a senior Church official was facing criminal charges for covering up sexual abuse.

The archdiocese had a debt of $300 million, Chaput said in an interview, and about 60 percent of the parishes were being subsidized by the other 40 percent. Many had “huge buildings” that were inefficient and needed repairs, he said. And Mass attendance throughout the archdiocese, even in the suburbs, had dropped.

“When they don’t come,” he said, “they don’t give.”

Chaput said he spent 20 minutes with Pope Francis in the Vatican in February and briefed him on the situation in Philadelphia.

“I told him he could be a source of healing for us after the pain of the last several years,” he said. “The Church here, we’ve had it bad. And we’re in need of healing.”