Deuteronomy 25:5-6

5 If brothers dwell together, and one of them die, and have no child, the wife of the dead shall not marry without to a stranger: her husband's brother shall go in to her, and take her to him to wife, and perform the duty of an husband's brother to her.

6 And it shall be, that the firstborn which she bears shall succeed in the name of his brother which is dead, that his name be not put out of Israel.