What happens if a senator dies while holding office?

When vacancies happen in the representation of any State in the Senate, the executive authority of each State shall issue writs of election to fill such vacancies: Provided That the legislature of any State may empower the executive thereof to make temporary appointments until the people fill the vacancies by election as the legislature may direct.