SANTIAGO DE COMPOSTELA, Spain — There are the pilgrims who hobble along with a staff, painstakingly making their way through a monthlong journey of contemplation. Then there are the others, looking all the fresher for walking a shorter route or paying a tour operator to carry their backpacks, and more likely to be clutching a cellphone or a guidebook.
All, however, must navigate the proliferating array of souvenir shops selling Jesus key rings and T-shirts and painted scallop shells: the symbol of the pilgrimage to the shrine of St. James, which ends in this city in northwestern Galicia and has become known simply as the Camino, or the Way.
The surge in popularity of the pilgrimage, which dates from the ninth century, has turned what was a spiritual obstacle course in medieval times into a booming part of modern Spain’s tourism industry. At a time when other parts of the economy are still suffering, the pilgrimage has become big business here — so much so that it has invigorated not only local economies but also a debate over how to balance mass tourism and spiritual reflection.
“You suddenly find yourself, exhausted, walking alongside people who are in party mood, as if they were heading to an entertainment park,” said Marie Ange de Montesquieu, who works for a Christian radio station in Paris and was completing a 480-mile route that began on the French side of the Pyrenees.
Still, she was philosophical. “It’s like life itself,” she added, “a mix of pleasant and less pleasant experiences.”
Such challenges transcend Santiago. In southern Spain, the municipality of Aznalcázar announced earlier this year that it would impose an environmental fee on pilgrims going to worship the Virgin of El Rocío, to cover the cost of cleaning up the trash left in the wake of the springtime passage. The decision generated an outcry, forcing Aznalcázar to shelve the plan.
Near Santiago, dozens of private establishments have started to compete with the network of government-owned hostels, and some municipalities have been pushing to add more official routes to the Camino, hoping to benefit as well from this tourism bonanza.
Santiago was the final resting place of St. James, and the discovery of his remains created one of the main medieval pilgrimages. Its importance dwindled because of the rise of Protestantism and the effects of the plague and conflicts, which hindered European travel.
In 1984, just 423 pilgrims were certified as having completed the route here. This year, an estimated 240,000 pilgrims are expected to come, up from 215,880 last year. The most prominent recent visitors included Chancellor Angela Merkel of Germany and Prime Minister Mariano Rajoy of Spain, who walked a short part of the route when they held a meeting on Aug. 24.
Ahead of Ms. Merkel’s visit, Santiago’s mayor, Agustín Hernández, criticized the lack of public money spent on upgrading the access ways to his city for pilgrims. In an editorial, El Correo Gallego, a regional newspaper, urged Ms. Merkel to pressure the Spanish government to invest more in the Camino.
The reasons for the growing popularity of the pilgrimage are not altogether clear. The Roman Catholic Church has welcomed the swelling numbers as evidence of a religious pickup, perhaps coinciding with hard economic times. The number of people attending Mass in Spain rose 5.7 percent in July from a year earlier, according to a study by the Center for Sociological Research, a government institute.
But it has no doubt helped, too, that with joblessness at about 25 percent in Spain and also high in other parts of Europe, people have more time on their hands. Many have chosen to travel, helping to leave tourism one of the few unscathed parts of the Spanish economy. Last year, Spain welcomed a record 60.6 million visitors.
The Camino has “given me confidence that I can overcome obstacles like not having work,” said Maria João Martins, who is from Portugal and lost her job as a supermarket cashier in 2011.
Much of the Camino’s recent growth has come from abroad. Lolita Forján, the owner of a grocery store in the village of Escravitude, was excited about having recently welcomed clients from Alaska and South Africa. “Who would have thought that a pilgrim would ever show me a bank note with Mandela’s face on it?” she said.
Ms. Merkel followed in the footsteps of Germans whose presence on the Camino almost tripled in a decade, reaching 16,203 pilgrims last year. German interest rose after Hape Kerkeling, a television presenter, published a 2006 diary of his pilgrimage that became a best-seller. “The Way,” a 2010 movie featuring Martin Sheen, helped broaden awareness among Americans.
Such is the popularity of the Camino today that many of the more devout pilgrims now travel off-season to avoid the summer rush, according to Maria Angeles Fernández, the president of the Spanish Federation of Associations of Friends of the Camino de Santiago.
In the village of Faramello, a new hostel with 40 beds opened in May. “This tourism has really become the main opportunity to find work around here,” said Concha, the receptionist, who would not give her full name. Before finding this job, she had been unemployed for five years, she said.
The Spanish authorities “must strike a balance between developing tourism and maintaining the tradition of the Camino,” warned Lijia Zhang, a Beijing-based writer, who spent two weeks walking in August. “Otherwise it will lose its soul, and therefore its appeal, before too long.”
Other pilgrims describe their experience as unforgettable, even if some seasoned visitors remember more fondly earlier and less commercial times.
For pilgrims, the final hurdle comes in Santiago itself, at the office where certificates are delivered to those who have walked at least the last 100 kilometers, or 62 miles.
There, the line in August can take as long as three hours, said Walt Scherer, an American volunteer. Mr. Scherer, a former mayor of Loomis, Calif., discovered the Camino after surviving colon cancer. As a young pilgrim complained to him about the line, Mr. Scherer replied, “The first thing you should learn on the Camino is patience.”
Virginia Gómez and César Martínez, an unemployed couple from Madrid, said they were delighted to have reached Santiago but disappointed by the costs of nearly everything along the way. Some establishments did not provide free toilet paper, they said.
“I didn’t think you needed to bring a full wallet to a pilgrimage,” Ms. Gómez said.