She wrote that anyone who owned a high-powered semiautomatic rifle similar to the one used in Orlando was not welcome in either of her two restaurants. That was not all: She would not welcome anyone who merely supported the idea of owning such a weapon.

As the battle over gun rights rages in the political arena, a small but growing number of restaurants are enforcing their own rules to try to counteract the wave of gun violence that has erupted in places like Newtown, Conn.; San Bernardino, Calif.; and Charleston, S.C.

Some chains have declared themselves gun-free zones, often in response to state “open carry” laws that allow people to take unconcealed firearms into establishments like restaurants, including those that serve alcohol.

In 2013, Starbucks was one of the first chains to ask that its customers leave their firearms at home. Since then, Chipotle, Chili’s, Panera Bread and others have joined the list. In Texas, an open carry law that went into effect in January also allowed businesses to opt out, prompting several restaurants across the state to do so.

Gun rights advocates, who believe not only in the right to bear arms but also that carrying them in public makes them safer, have staked out their ground, too. In Texas, at least one barbecue restaurant offers discounts to diners who show up with their weapons. The website of Gun Owners of Maine, an advocacy group, carries a list of “gun-unfriendly businesses,” including Ms. Verrill’s restaurants: Grace, a renovated 1856 Gothic Revival church in Portland, and the Foreside Tavern, in nearby Falmouth.