This practice of levirate marriage, though unique to Deuteronomy, is not unique to Israel; it was common throughout the ancient Near East. It simply states that if a married man dies childless, his brother must marry his widow and father a child who will be considered the son of the deceased man (vv. 5-6). Not to do so was considered a grave offense that resulted in stigmatization (vv. 7-10). This legislation was required to provide for the widow, keep land and other matters of inheritance within the family, and to ensure that the deceased person's name and clan will continue. Genesis 38:8 and Ruth 4:5-6 are variants of this legislation.
Problems with the incest legislation of Leviticus 18:16; 20:21 that prohibits sexual congress with one's sister-in-law have led some to claim that "brother" in this context may refer to the deceased husband's nearest male relative, whether that person is an uncle, a cousin, or a brother. It is better to see the special circumstances surrounding the levirate marriage as an exception to the prohibitions in Leviticus.
5 When brothers reside together, and one of them dies and has no son, the wife of the deceased shall not be married outside the family to a stranger. Her husbands brother shall go in to her, taking her in marriage, and performing the duty of a husbands brother to her, 6and the firstborn whom she bears shall succeed to the name of the deceased brother, so that his name may not be blotted out of Israel. 7But if the man has no desire to marry his brothers widow, then his brothers widow shall go up to the elders at the gate and say, My husbands brother refuses to perpetuate his brothers name in Israel; he will not perform the duty of a husbands brother to me. 8Then the elders of his town shall summon him and speak to him. If he persists, saying, I have no desire to marry her, 9then his brothers wife shall go up to him in the presence of the elders, pull his sandal off his foot, spit in his face, and declare, This is what is done to the man who does not build up his brothers house. 10Throughout Israel his family shall be known as the house of him whose sandal was pulled off.
New Revised Standard Version Bible: Anglicized Edition, copyright © 1989, 1995 National Council of the Churches of Christ in the United States of America. Used by permission. All rights reserved worldwide. http://nrsvbibles.org