If a presidential candidate in the USA drops out of the race before (or during) election day, but after early voting has begun, what happens to that party's ticket?

For example, if Donald Trump or Hillary Clinton drop out of the 2016 American presidential race now (October, 2016), what happens?

The vice presidential candidates on their tickets are ***not*** running for the office of president, so it's not clear if the "line of succession" would be implemented or something else would happen.