The options are:
Tourist visa in your home country (1-3 entries, 60+30 days on each entry)
Documentation is not particularly difficult. Exact requirements vary depending on the consulate, but usually it's a 1-page application form, two photos, copy of confirmed flight itinerary and a recent bank statement showing some minimal balance ($1500 or so). Visa fee is $35 per entry (plus postage both ways if applying by mail).
Applying by mail is possible in most countries, allow at least 2 weeks turnaround time. The disadvantage is a small chance that your passport may get misplaced.
Applying in person normally involves two visits, one to turn in the documents, and then next day to pick up the visa. The consulates are closed on Thai and US holidays. In large countries (USA, UK, Germany) there are several honorary consulates which tend to be less fussy and far more polite than the Thai Embassy in DC or large consulates (LA, NYC, Chicago). However, they may be hard to find and have limited hours.
An advantage of applying before the trip in your home country is that you can ask for a 2 or 3-entry tourist visa, which gives you a longer stay. Consulates in SE Asia generally issue only single-entry visas.
Allowed stay is 60 days per entry. A one-time 30-day extension stamp can be obtained at an immigration office within Thailand (takes ~3-6h, 1900 baht).
Visa-free entry by air (30 days)
To extend, fly to one of the neighboring countries and come back (there are many low-cost airlines, like AirAsia). You can also exit Thailand by land and fly back one-way.
Technically, Thai immigration (or the airline) may ask you to show an air ticket back to your home country within the 30 days and proof of funds, but this is rarely enforced, especially if you look clean-cut.
Visa-free entry by land (15 days)
Entering Thailand through any land border crossing (most often to Cambodia or Laos) allows you to stay for only 15 days.
A visa-run (crossing the closest border and coming back to Thailand immediately) is often used. There are tour companies which facilitate this (usually to Poipet, Cambodia as this is closest to Bangkok).
Laos and Cambodia charge for visas at the border ($20-$40). Therefore, a visa-run by a low-cost airline to a place which does not charge (e.g. Singapore or Malaysia) for a 30-day entry may not be more expensive than two 15-day visa-runs by land.
Tourist visa in SE Asia (60+30 days)
Thai consulates in SE Asia issue single-entry tourist visas to foreigners, allowing a 60 day stay and 30 day extension. Documentation requirements tend to be minimal (less than in your home country). Most commonly used ones are in Penang, Malaysia and Vientiane, Laos (latter can be easily reached by land, 8hr by bus from Bangkok). Usually the service is next-day. Relatively affordable and reliable agents can be used to avoid standing in lines.
Some consulates (Rangoon, Hong Kong, HCMC) are known to be restrictive, check before going.
- 30-day by air / 15 days by land policy applies to most Western passports (e.g. USA, UK, France, Germany). For specific details that apply to your nationality, check the requirements by nationality. Some countries (e.g. Brazil, Korea), get 90 days visa-free either by land or air.
- Rules change often, above is valid as of October 2011.
- Visa requirements and fees can vary at different consulates (even within the same country). Thai consulate websites are often out-of-date.
- Visa validity date indicates the last allowed entry date, not to allowed duration of stay. For example, a tourist visa valid until 2011-12-31 means that this is the last day you'll be allowed to enter Thailand. Duration of stay is determined by the entry stamp (60-days normally, double-check after immigration).