At a black Pentecostal church in Raleigh, N.C., the Rev. Patrick Wooden entered the sanctuary on Sunday to a standing ovation, exulting that God’s “high hand” had led voters last week to pass a statewide amendment banning same-sex marriage. He took to the pulpit and denounced President Obama for taking a stand “in support of sin,” and “in opposition to the biblical model of marriage.”

A thousand miles away, at a predominantly white, Lutheran church in Madison, Wis., where a rainbow banner greets churchgoers arriving for services, the Rev. Susan Schneider preached that gay men and lesbians were included when Jesus commanded his followers to love one another: “Knocking down the walls is what Jesus was after.”

Mr. Obama’s declaration last week that he supports same-sex marriage prompted ministers around the country to take to their pulpits on Sunday and preach on the issue. But in the clash over homosexuality, the battle lines do not simply pit ministers against secular advocates for gay rights. Religion is on both sides in this conflict. The battle is actually church versus church, minister versus minister, and Scripture versus Scripture.

The dividing lines are often unpredictable. There are black churches that welcome openly gay couples, and white churches that do not. Some Presbyterian churches hire openly gay clergy members, while others will not. The Roman Catholic Church teaches that homosexual behavior is a sin, but there are Catholic priests who secretly bless gay unions.