What happens...

Re: What happens...

^
The RNC (Republican National Committee) would organize a second convention or meeting and the delegates would choose the new nominee. It does not necessary have to be the second highest delegate winner but that person would have a strong argument that he should be the replacement as would McCain's VP choice. But there is no law of succession like there is for elected officials so no one would be a lock replacement if such a death occurred until after the RNC met and decided.

Also keep in mind U.S. citizens don't vote directly for the President (or VP) but vote for state electors who cast votes for the President (and VP) that the majority of the citizens of state choose... but they, the electors, are not federally legally bound to vote for the states choice (ie: the candidate who received the most votes from the state they represent) and may vote for either candidate. While there is not any federal laws forbidding this some states do have laws against electors who go against the states choice, but almost 50% of states have no such laws.

What this means...
That means that it is technically possible for McCain or Obama to win on election night in November but not become the President as the electors don't cast their vote until December. This situation is highly unlikely to occur (unless the winner dies after the November election but before the electors vote in December) as the electors voted for in by the State in November are long time loyal party members and highly unlikely to go against their own party. But the rules as written do allow conspiracy theories to flow :-)