Vietnam's train system is a lot better than is used to be, and while it's not all that cheap, it's comfortable, exceedingly scenic in places, and an overall very interesting and fun way to travel.
If you're travelling in high season or especially over Tet, book as far in advance as possible. On the downside it serves only the Vietnamese coastline along with a couple of spurs out of Hanoi (most notably northwest to Sapa). The coastal line serves many of the key destinations in Vietnam, notable exceptions are Hoi An (alight at Da Nang), Qui Nhon (alight at Dieu Tri) and Mui Ne (alight at Muong Man).
The Railways Vietnam website has comprehensive and accurate timetable and price information. Travelfish members can also avail themselves of the PDF timetable and pricelist we put together after fighting our way through the Vietnam Railways website. You can download it from the resources section of the Member Centre.
You can read a very detailed story on Vietnam's rail network here.