The United States presidential line of succession has changed a couple of times over the history of the country, the last of which being The Presidential Succession Act of 1947, signed by President Harry Truman, which created the order that exists today. The cabinet members are ordered in the line of succession according to the date their offices were established.
The order by which a person would ascend to the presidency is as follows:
- Vice President
- Speaker of the House
- President pro tempore of the Senate
From here, the order of succession runs through the members of the president's cabinet, starting with Secretary of State, according to the date their offices were established.
Incidentally, only one president in the history of the United States has ever gained the office without being elected either as president or vice president — Gerald Ford. When Richard Nixon's vice president, Spiro Agnew, resigned in 1973 after pleading no contest to income tax evasion, President Nixon appointed Ford to replace him (Congress approved the nomination). Then in 1974, when Nixon resigned the presidency as a result of the Watergate scandal, Ford took the high office.