All indications are that the Sith Master will kill the apprentice and take on a new one. That said, the Master has absolute power and can theoretically choose to spare the apprentice's life in order to avoid having to start all over with a new apprentice.
Canon
The best canon description that I'm aware of regarding how the Rule of Two functions is:
Soon after destroying the Jedi, the Emperor had told Vader that he would one day be tempted to kill him. He’d said that the relationship between Sith apprentice and Master was symbiotic but in a delicate balance. An apprentice owed his Master loyalty. A Master owed his apprentice knowledge and must show only strength. But the obligations were reciprocal and contingent. Should either fail in his obligation, it was the duty of the other to destroy him. The Force required it. Since before the Clone Wars, Vader’s Master had never shown anything but strength, and so Vader intended to show nothing but loyalty. In that way, their mutual rule was secure. Perhaps Vader would attempt to kill his Master one day. Sith apprentices ordinarily did. They must, if they were trained well. An apprentice was unquestioningly loyal until the moment he wasn’t. Both Master and apprentice knew this.
Lords of the Sith, p. 27
This quote makes it clear that it was the duty of the Master to destroy the apprentice if the apprentice showed disloyalty. The quote also makes it clear that the apprentice was expected to show disloyalty at the moment the apprentice challenged the Master. Taken together, this seems to be clear evidence that the Sith Master would destroy the apprentice if the apprentice challenged the Master but was defeated.
Legends
There are much better descriptions of the Rule of Two in Legends, and in Legends we have access to the thinking of both Darth Bane and his apprentice -- the two Sith Lords with the best understanding of the Rule of Two.
Darth Bane was resolved to kill his apprentice, named Darth Zannah in Legends, if she confronted him and failed, even though it would leave him without an apprentice and a failing body:
[Bane thinking to himself] An apprentice had to earn the title of Dark Lord, wresting it from the Master in a confrontation that pushed them both to the edge of their abilities. If Zannah intended to challenge him only after he was crippled by illness and infirmity, then she was unfit to be his heir. Yet Bane was not willing to initiate their confrontation himself. If he fell, the Sith would be ruled by a Master who did not accept or understand the key principle upon which the new Order had been founded. If he was victorious, he would be left without an apprentice, and his failing body would give out long before he could find and properly train another.
Dynasty of Evil, p. 11
Darth Zannah also thought that Darth Bane would kill her if she failed while challenging him:
[Zannah speaking] The Master will train his apprentice in the ways of the Sith, until one day she must challenge him. If she proves unworthy, the Master will destroy her and choose a new apprentice. If she proves the stronger, the Master will fall and she will become the new Dark Lord of the Sith, and choose an apprentice of her own.”
Dynasty of Evil, p. 153
It seems clear that the Rule of Two required the Master to kill the failed apprentice even if the Master was in poor health, and this comes from the two Sith Lords best acquainted with the Rule.