It depends on the source of the loan.
Federal loans (such as Direct Stafford or Perkins loans) are discharged if the student passes away, so the debt is not transferred to family members. However, the family does need to apply for the discharge and provide evidence (usually a death certificate) that the student has passed away. Unfortuately, many families who are not aware of this struggle to pay off their student's loans when they don't need to.
Private loans are different. If a family member co-signed for the loan, he/she will most likely become responsible for it. Since most private student loans require a co-signer, this is what happens most frequently. If the student did not have a co-signer, the debt passes to the student's estate. This means that if the student had any assets, such as a house, car or money in the bank, they may be used to satisfy the debt. If the assets are not enough to cover the debt, the lender must write off the remainder. So, family members may inherit less as a result of the debt having to be paid before they can claim anything, but the debt itself is not transferred to them.
In recent years, a few private lenders (SallieMae in particular) have started to change their terms to include a discharge in the event that the borrower dies, but the majority of lenders do not offer this.