“It’s important that we uphold Catholic values,” Mr. Fox said, before adding, “This is also 2011, so things change.”

And at the front of the church was the priest, who, Mr. Grisanti recalled, “put a hand over his heart and kind of pounded his chest, and pointed to me and smiled.” Mr. Grisanti said he was unsure what that meant.

Now, Mr. Grisanti and the three other Senate Republicans who provided votes necessary to legalize same-sex marriage in New York are confronting the uncertainty of how voters in their districts will react. Voter response will influence the balance of power in the New York Senate, where there are just two more Republicans than Democrats. And the events in New York also have national repercussions: because several Democratic-dominated states have already legalized same-sex marriage, gay-rights advocates increasingly need Republican support if they are to change local laws elsewhere in the country.

Some Republican donors, as well as Mayor Michael R. Bloomberg and leaders of the gay-rights movement, have promised to support the re-election campaigns of the four New York lawmakers. But the National Organization for Marriage, a group opposed to same-sex marriage, said it would spend $2 million in an effort to defeat the legislators, and key elements of the senators’ traditional political base have vowed to withdraw support.

“One thing I know for sure, these four people will not have the Conservative Party endorsement,” said Michael R. Long, chairman of the state Conservative Party. “That is certain.”