Thailand has an extensive network of rail lines that connect the whole of Thailand and its neighboring countries. It’s even possible to take the train as far as Singapore. Domestic trains are rather slow compared to air and bus travel, but they are comfortable and cheap. Though it’s not the most practical way to travel if time is of concern, it’s definitely worth trying for the experience. A popular choice is traveling in the overnight 1st class sleeper cabins.
The railways are operated by the State Railway of Thailand SRT (http://www.railway.co.th/). The website has an easy to read timetable with prices in English. Another website that has good information is Seat61 (http://www.seat61.com/Thailand.htm).
The main train station and hub of all travel by train in Thailand is Hualamphong Station located near Chinatown and Silom and on the MRT line. Besides Hualumphong train station there are several other small train stations in Bangkok, such as the Bangkok Noi station on the Thonburi side of Chao Praya.
There are four main lines connecting Thailand by rail: The Northern Line (Chiang Mai), The Northeastern Line (Nong Khai and Laos border), The Eastern Line (Ubon Ratchatani and Thai-Cambodian border) and The Southern Line (Surat Thani, Malaysia Border).
Trains in Thailand are very safe with very little risk of theft or crashes. They are slower than buses and do not connect everywhere, but their safety and comfort make up for it. Seats should be booked in advance if you want an air-conditioned sleeper berth or 1st class cabin. Second and 3rd class are usually available just by showing up.
Train travel has become less attractive since Nok Air (http://www.nokair.com) and Air Asia (http://www.airasia.com), have begun flying domestic to many towns and cities in Thailand at costs that are almost competitive with first class train travel.