As far as I can make out, technically US voters don't elect the President, they elect a slate of electors in each State to the electoral college. So if the candidate sponsoring the slate dies, then it's down to state laws as to whether the electors are bound to the nominating party or are free to vote as they please. In practice, one assumes they are party loyalists who will vote the party line. That means that whichever party wins will nominate a new candidate and the electors will duly vote him/her in.
If the sick candidate survives until the electoral college votes in December, it gets tricky. The electoral college votes are "counted" ie recognized by the incoming Congress in early January and the winner then becomes president-elect. If s/he dies at that point the vice-president-elect takes over. If s/he dies after the electoral college votes, but before the new Congress meets, the rules don't really specify what happens! Theoretically, it's down to Congress, but in practice all bets would be off at that point....