ATLANTA — As it looks increasingly likely that the Supreme Court will establish a nationwide right to same-sex marriage later this year, state legislatures across the country are taking up bills that would make it easier for businesses and individuals to opt out of serving gay couples on religious grounds.

Many states are now reliving a version of events that embroiled Arizona in February 2014, when Gov. Jan Brewer, a Republican, vetoed a bill that would have allowed businesses to use their religious beliefs as a legal justification for refusing to serve gay customers.

The resurgent controversy is fueled in part by a deep anxiety among many evangelicals and other conservatives that the Supreme Court will make same-sex marriage legal in all 50 states after it takes up the matter in April.

“The L.G.B.T. movement is the main thing, the primary thing that’s going to be challenging religious liberties and the freedom to live out religious convictions,” said State Senator Joseph Silk, an Oklahoma Republican and the sponsor of a bill in that state. “And I say that sensitively, because I have homosexual friends.”