Before you book your trip, you'll want to check to see if a visa is required. Thailand has traditionally been rather free with visas, and most westerners still receive 30 day entry stamps on arrival at any airport (if crossing by land, you will only get a 15 day visa). However, like just about every other country since 2001, security concerns have lead to a reduction in the number of countries automatically granted visas. For a current list of countries entitled to visa-free entry, visit the Thai Foreign Ministry's web site.
If you do need a visa, or plan to stay longer than 30 days, you can generally easily get a 60 or 90 day visa at most Thai embassies and consulates. This can usually be done by mail if there's no consulate in your city.
Note: As of March 2006, the penalties for over-staying your visa have been significantly increased. Although you are given one days grace, over-staying your visa by two days will now cost you 1,000 Baht (25.97 USD). More than two days will add 500 Baht (12.99 USD) per day. If you need to over-stay your visa due to a problem getting flights on the right day, you are urged to visit the immigration department where you're staying to get a short extension to your visa. The cost of extending your visa is much less than the over-stay penalty.