There are other similarities between the cases. Both bakeries said they did not discriminate against gay people and were happy to serve anyone. All the bakeries objected to, they said, was being forced to convey a message at odds with their faith.

But there are differences, too, ones that illuminate the limits of each side’s arguments.

The cake in Northern Ireland would have included words. David D. Cole, a lawyer with the American Civil Liberties Union, which represents the gay couple in the Colorado case, told the justices that his clients had not asked the baker to include words on their cake or, indeed, to send any message at all.

“There was no request for a design,” Mr. Cole said. “There was no request for a message. He refused to sell them any wedding cake. And that’s identity-based discrimination. It is not a decision to refuse to put particular words on it.”

The cake Mr. Lee wanted, on the other hand, would have included the phrase “Support Gay Marriage,” which is certainly a message. On the other hand, what the Irish bakery does sounds mechanical rather than creative. “The image provided by the customer is scanned and individually put through the printer using inkjet, sized and placed on the cake,” Ms. McArthur explained.

Kristen K. Waggoner, a lawyer with Alliance Defending Freedom, which represents the Colorado baker, Jack Phillips, said her client objected to using his artistic talents to create something custom-made and unique.

“When we have someone that is sketching and sculpting and hand designing something, that is creating a temporary sculpture that serves as the centerpiece of what they believe to be a religious wedding celebration, that cake expresses a message,” Ms. Waggoner told the justices.

There is another difference between the two cakes. The one in Northern Ireland was for a party, not a wedding. The Colorado cake was for a wedding and so would have taken on meaning from its context, Ms. Waggoner said.