But the defenders of the shop owners argue that creating an artistically involved or personalized service for a same-sex wedding is a form of expression that should not be compelled by the government. They reject the discrimination charge, noting that many of the businesses have gay and lesbian customers, and, in some cases, employees.

“Anyone who would suggest this is not about freedom of religion doesn’t know or understand what religious liberty is about, which is the freedom to do what your conscience directs,” said Alan Sears, the president of the Alliance Defending Freedom.

Mr. Sears says he has experienced his own form of bias: He says that a photographer in Southern California declined to shoot a portrait of his family for a Christmas card after discovering that Mr. Sears heads an organization that opposes same-sex marriage. Mr. Sears said he supported the photographer’s right to refuse service, just as he would support a gay baker’s right to refuse to make a cake with an anti-gay message.

Vendors thus far have accumulated a losing streak in wedding and similar cases. In Kentucky, for example, a hearing officer recently ruled against a print shop owner who refused to make T-shirts for a gay pride group.

Advocates for the vendors hope the court system will prove more sympathetic to their constitutional claims than civil rights agencies have been, even though the Supreme Court this year refused to hear an appeal from the New Mexico photographer. They are also pursuing legislation; in Michigan, the State House this month approved a measure that would protect business owners, while in South Carolina and in North Carolina, lawmakers are proposing measures allowing local officials to opt out of issuing same-sex marriage licenses.

Like many of the religious business owners, Mr. Phillips, who attends a Southern Baptist church, says his faith guides not only his personal behavior, but also the way he runs his business. So while he says he welcomes all customers — and happily sells cookies and brownies to gays and lesbians — he says he is not comfortable pouring creative energy into confectionary centerpieces for celebrations he believes to be at odds with God’s will.

But for Charlie Craig and David Mullins, the couple he turned away, the incident was a form of bias. They married in Massachusetts — same-sex marriage was not legal in Colorado at the time — but were holding their party in Denver, where they live.