I can remember a time not long ago when the prospect of armed men in places of worship was a joke rather than a constant reality.

In fact, I’ve heard more than one preacher tell a joke from the pulpit about masked men with guns walking into a church, firing shots in the air and saying, “Whoever doesn’t believe in God, you can leave.”

When most of the congregation files out the door, the joke goes, a strange thing happens. The gunmen take off the masks, put down their weapons, and sit in the pews.

“We just wanted to see who the real believers were,” they say. “Now we can worship together.”

I wish men with weapons in places of worship were still a joke. But now it’s a sad and frightening reality — one that’s repeating itself and spreading like cancer in places all over the world. The latest shooting, in a California synagogue, happened while people worshiped at the end of the Jewish holiday of Passover.

On Easter weekend, two churches in Sri Lanka were attacked by suicide bombers, killing at least 290 people. A few weeks before, two mosques in New Zealand were attacked by a single gunman, killing 50. In Pittsburgh last October, 11 were shot dead at another synagogue. In Louisiana, three black churches were burned over the past month, and four years ago in South Carolina, nine blacks were killed by a self-proclaimed white supremacist who shot them at Bible study.

Most of the attackers are young. Sometimes they’re well educated, but, in every case, they have one thing in common. The attackers are driven by hate.

Hate that would make a 19-year-old throw away his life to kill a stranger in a California synagogue. Hate that would make a 21-year-old kill nine people who welcomed him to Bible study. Hate that would make the sons of a rich man kill more than 250 people on Easter.

Places of worship must guard against these kinds of dangers. Many black churches have known this for some time. Enon Tabernacle Baptist Church, one of the largest congregations in Philadelphia, is among the churches that adopted security measures long ago. The church has armed and unarmed security that is both seen and unseen during church activities.

The Rev. Dr. Alyn E. Waller, Enon’s senior pastor, says security initially was tied to guarding the church’s finances. But he says black congregations have long been aware that they must also guard themselves against hate.

“For us as black Christians, we should not respond to this like white people,” Waller told me in an interview. “And what I mean by that is, white people are surprised to find out how mean the world is, but we have known this. We have been in church and had people come against us because we were black and Christian.

“We had a black church [in Alabama] in the Sixties blown up, killing four little girls. And a few years ago we had nine people killed in a church in South Carolina.”

Waller added: “I’m sorry that happened to Jewish people in those synagogues. But we as black people have known this reality and have been dealing with this reality.”

Sadly, he is right.

Black church congregants discovered long ago that hate could visit them during worship. They learned that hate is like a fast-moving disease that eats at people from the inside, and tumbles out in acts of violence.

I asked Waller what we should do to guard against violence in places of worship. He said people of faith must lead the way and show how to disagree without becoming violent.

I think he’s right. Instead of giving in to the cancer of hate, we have to dedicate ourselves to stopping it. That means dwelling on what we have in common, instead of focusing on what we don’t. It means seeing the God in everyone, whether we practice a faith or we don’t.

Difference is in God’s design. I believe this deeply as a man of faith. Some believe differently, but there is a way to hear, acknowledge, and respect the beliefs of others without resorting to violence.

Waller put it best: “I think that we in the faith community have to, like never before, model how to get along, and agree to disagree.”

Solomon Jones is the author of 10 books. Listen to him weekdays from 10 a.m. to noon on Praise 107.9 Email: sj@solomonjones.com. On Twitter at @solomonjones1