The governor of Arizona appoints a (Republican) replacement who serves either until a special election in 2018 or until McCain's term is up, in 2020. It's rather late in the season for a special election + primaries, and the Arizona seat is not very safe at the moment, so the replacement will probably serve until 2020. There's a good chance his wife will be appointed.