If you're outside of Thailand, you can get a 60 day visa for about $30, and that can be extended a further 30 days once inside Thailand for another fee (I never did this, but I think it's around another $30.) The consulates in countries around Thailand are aware of people entering, leaving and getting a new visa, then re-entering. Certain consulates will almost always give the visa, some will deny if they see repeat visits - it really depends on the guy looking at the paperwork at the time sometimes.
For example, when I was there last year, the consulate in Penang, Malaysia was known to give back to back 60 day visas as long as you never did the 30 day extension. But they wouldn't give the multiple entry visas that basically give you the 60 days + 30 days extension each time you enter the country for 2-3 entries.