This question addresses what happens if a winning US Presidential candidate is incapacitated after the general election but before inauguration, and the line of succession clearly covers the period after the inauguration. If incapacitation occurred before or maybe even at the convention, presumably the delegates would just ignore the primaries and pick somebody else. This question addresses what happens if a major party nominee is incapacitated with enough time before the general election to permit the party's Committee to choose a substitute.
However, what would happen if a nominee for US president (on all 50 states' ballots) were to become completely incapacitated just prior to or even on election day, after at least some ballots etc. with those candidates' names have already been prepared, and without sufficient time for party leaders to vet and nominate a replacement? (What if the same incapacitating event knocked the running mate out of the race too?)
Is the answer any different for races lower on the ticket (Congress, state, or local)?
For the purposes of this question, please make the (admittedly shaky) assumption that the nominees were not already "incapacitated" by the time they reached nomination.