Actually, for the US, the overarching rule is spelled out in the Constituition. There's a line of succession from President to Vice President to Speaker of the House. The 25th Amendment deals with who's in charge after that. That's why the President's cabinet picks are so important.