BETTIAH, INDIA—A jeep traveling through this small town in rural Bihar State affords the usual sights: the traffic chaos of donkey carts, cycle-rickshaw wallahs, motorbikes carrying six-person families, wandering cattle and pigs—all contributing to the cacophony of urban Indian life. As the town chaos thins out, there are other sights such as: haystacks, sugar cane fields and bright pink saris. And then, along the roadside, one pile of brown material after the other, in a shameful line. This is where the people of this part of town come every morning to defecate—either because they have no toilet or they prefer to squat on their haunches in the open.

That preference is the bane of anyone attempting to solve the world's woeful sanitation situation. Over two billion people still lack toilets, and while low-cost toilet solutions are available, many people here in India still choose to do their business outdoors due to cultural inertia. Yet, a single gram of feces can carry 10 million viruses, one million bacteria, 1,000 parasite cysts, and 100 worm eggs. These hazards can be carried back on feet and fingers into food and water. Uncovered waste kills more children annually than HIV/AIDS, TB and measles combined. In India, 626 million people persist in defecating in fields, on roadsides or anywhere but in a toilet, although their children die of diarrhea and their wives and daughters must wake up at 4:30 AM to have the modesty of darkness, risking rape, snakebites and—no small matter in these parts—ghosts.

I am in Bihar with the Great Wash Yatra, a carnival of sanitation and hygiene organized by the German non-governmental organization WASH United and the Indian design agency Quicksand. The Yatra—"journey" in Hindi—has traveled 2,000 kilometers through rural India in 51 days, stopping in six towns and villages to spread its messages: stop defecating in the open, wash your hands with soap before eating and break the silence around menstrual hygiene. (In these areas girls are never told what to expect before they first menstruate. As a consequence, they often think they are injured or diseased, or believe in local folk superstitions such as that a menstruating girl's touch makes pickles go rotten.)

The Great Wash Yatra spreads these messages using the oldest social engineering trick around: Make the lesson fun. Leaders organize interactive games such as Poo Minefield, where a blindfolded contestant must avoid the piles of excreta and pick up soap bars. People bowl out the diarrhea demon; or pitch poo-balls at giant germs. The organizers stage songs and Bollywood dances with sanitation and hand-washing themes and a "WASH Idol" contest. Celebrity endorsements from superstar cricketers and Bollywood actresses add glamour. The queues are always huge; the kids always love it; and the messages, it is hoped, will enter via this lateral route of fun and Bollywood stardust and so stick.

The Great Wash Yatra is not the first attempt to promote toilet use in the 65 years since Indian independence. Millions of dollars have been spent on toilet-building government schemes. Millions of those toilets have been turned into storehouses that their owners pass while strolling to their chosen defecation ground. Dozens of United Nations agencies, NGOs and corporations have spread health and hygiene messages, dispensed soap and scratched their heads at why so many million Indians can still be found day in day out using roadsides and fields as a toilet.

A dozen kilometers from the Yatra site in Bettiah is the village of Lokhara, home to about 250 households. It is beautiful and quiet, a blessed relief after the cacophony of even small-town India. More strikingly, it is clean. There is no trash, as there is spread over 100 square meters of open ground outside the Yatra site, and on every roadside. Lokhara’s houses are simple mud structures, mostly, with the odd brick construction. Subsistence farming is the norm; the daily wage if a wage can be found is 150 rupees (about $2.75). Yet nearly every poor mud house now has a simple, wonderful structure alongside the storehouses: a new, self-made toilet that costs peanuts and saves lives. And they were built not by the government nor NGOs but by the intangible art of psychological manipulation.

On September 11 this year a team from Feedback Foundation, a Yatra partner, came to the village and began to work with the villagers to change behavior. Their tools were basic social emotions: disgust, shame and pride. First the villagers were asked to draw a map of the village and to point out where each householder went to defecate. The amount of excrement lying around was totted up—it always adds up to metric tons. And then the realization came: flies fly from this excrement to food, and everyone was eating poop. As long as one family continued to defecate outside, everyone could be contaminated. That is the disgust and the shame. Those are the triggers. They entice behavior modification just as children are enticed through the doors of the Yatra by glow germs and poo minefields. Immediately, although villagers had defecated outside since time began, toilets began to be built. They cost anything from nothing to very little. Some were just dry pits with a simple grass superstructure, but they are a beginning.

The sarpanch—village leader—leads me round the village with great pride. He introduces the village monitoring team, young lads who get up daily at 3:30 A.M. to patrol the streets for open defecators and try to persuade them verbally: "It's easy to build a toilet, so why don't you? You are spending more on medical bills than a toilet would cost." In other villages children do this patrolling, banging pans when they find a defecating sinner, or giving them shame garlands of leaves. The methods differ but the truth they are based on does not: Open defecation becomes a community sin.

Three months on 95 percent of households have toilets, and they are clean and fly-free. At the end of the visit the sarpanch addresses a group of schoolchildren. He says, "Look at these visitors from abroad who have come to see us because of what we have stopped doing. What have we stopped doing?"

The children chorus: "Eating poop!"

They have also stopped dying from it. Six months ago—before the latest visitors came—the villagers Kalawti Devi and Sadina Khatan died of cholera. The sarpanch writes down "10 small sons" when I ask him for the names of villagers who have died from diarrhea. Ten other small sons will no longer die of filth. On World Toilet Day, that is something to celebrate.