If Mr. Nojay wins, election law states, Republican party leaders in the three counties that fall partly or fully within the 133rd Assembly District — Livingston, Monroe and Steuben — will choose someone to run as the general-election Republican candidate in his place. They have until 10 days after his death to do so, or about a week after the primary on Tuesday. If he loses to his challenger, Rick Milne, the mayor of the village of Honeoye Falls, Mr. Milne will simply claim the nomination. That is all “assuming that it isn’t a tie, or some other strange thing,” as Mr. Conrad pointed out.

The choice of a successor for Mr. Nojay lies with the chairmen of the Republican parties in each of the three counties, whose votes will be weighted according to the percentage of votes cast in each county the last time Mr. Nojay was elected. Given the district’s deep Republican bent, whoever ends up with the nomination will most likely go on to Albany next year to join the Republican minority in the Assembly.

With the support of local party leaders, the advantage of incumbency and widespread name recognition as the host of a daily talk radio show, Mr. Nojay, who was first elected to the Assembly in 2012 and was a prominent cheerleader for Donald J. Trump, was supposed to have little trouble on Tuesday. He was, however, fending off at least one federal investigation related to his business interests outside the Legislature.

On Friday morning, as police officers raced to Riverside Cemetery in Rochester to check on him, Mr. Nojay, who was 59, shot himself to death.