The 25th Amendment to the U.S. Constitution deals with this.
Vice-presidential vacancies. Until this amendment passed in 1967, vice-presidents who died in office were not replaced. Neither were vice-presidents who became president upon the death of the Chief Executive. This law was first used in 1973 when President Richard Nixon chose Gerald Ford to replace Vice President Spiro Agnew, who had resigned.