One of Muhammad's many wives (he had at least nine wives at one time, even though Qur'an 4:3 says Muslims are limited to four wives) was a woman named Sauda bint Zama'ah. As Sauda aged, she became unattractive and extremely overweight, and Muhammad decided to divorce her. Terrified of being abandoned in her old age, Sauda hatched a plan. She knew that Aisha was Muhammad's favorite wife, and that Muhammad would like to spend even more time with Aisha. So Sauda told Muhammad that, if he would keep her as his wife and not abandon her, she would give her sex night to Aisha. Thus, Muhammad would be able to spend twice as much time with Aisha. Muhammad was happy with the arrangement, and so was Allah, who revealed Surah 4, verse 128:
If a wife fears cruelty or desertion on her husband's part, there is no blame on them if they arrange an amicable settlement between themselves; and such settlement is best; even though men's souls are swayed by greed. But if ye do good and practise self-restraint, Allah is well-acquainted with all that ye do.
Here is Ibn Kathir's commentary on this verse:
Allah states, and thus legislates accordingly, that sometimes, the man inclines away from his wife, sometimes towards her and sometimes he parts with her. In the first case, when the wife fears that her husband is steering away from her or deserting her, she is allowed to forfeit all or part of her rights, such as provisions, clothing, dwelling, and so forth, and the husband is allowed to accept such concessions from her. Hence, there is no harm if she offers such concessions, and if her husband accepts them. This is why Allah said, (there is no sin on them both if they make terms of peace between themselves). He then said, (and making peace is better) than divorce. Allah's statement, (And human souls are swayed by greed) means, coming to peaceful terms, even when it involves forfeiting some rights, is better than parting. Abu Dawud At-Tayalisi recorded that Ibn `Abbas said, "Sawdah feared that the Messenger of Allah might divorce her and she said, `O Messenger of Allah! Do not divorce me; give my day to A'ishah.' And he did, and later on Allah sent down, (And if a woman fears cruelty or desertion on her husband's part, there is no sin on them both).
Allah's message to Muslim women: When you get old and become less attractive, be prepared to relinquish some of your rights, or your husband can kick you to the curb.