Are you wondering if you should reserve a bed on an overnight train? Well, it’s a good idea to actually book a bed in advance. There are two types of "bed coach" on European overnight trains: couchettes and "sleeping cars." Both are available on most trains, but you should always check to be sure. On some particularly fast or comfortable "hotel trains," only the more expensive "sleeping cars" are offered.
A couchette (litera in Spanish, liegeplatz in German, cuccetta in Italian) is a sort of dormitory bed, in a mixed-gender, four-, five-, or six-person cabin (single-gender cabins are available in Spain). The principal advantage is economy: Couchettes cost a roughly standard $18 ($28 if booked in the United States before you go). In addition to your vinyl shelf, you receive a pocket sheet (or sheet sleepsack), a pillow, and a blanket, and you may stretch out full length.
Sleeping cars offer more comfortable beds (with real mattresses, sheets, and blankets). Individual beds are bookable in single-sex compartments, or entire compartments may be rented by couples or groups. The compartments include wash facilities (and, more and more often, full showers).