Proof of onward transit :- long happily ignored by Thai immigration, has been known to be strictly applied in some instances (Indian passport holders beware). The requirement is for an international flight itinerary - NOT train, ferry, or other departure type. Airlines, who have to pay for your return flight if Thai immigration doesn't let you into the country, also check this and often will not let you board your flight for Thailand without it.) A print-out of an international e-ticket on a budget airline is sufficient to convince the enforcers, but those planning on continuing by land may have to get a little creative. Buying a fully refundable ticket and getting it refunded once in Thailand is also an option. Land crossings, on the other hand, are a very straightforward process and proof of onward journey is generally not required (Indian passport holders beware again... or anyone, if the border officials simply decide to uphold the bureaucracy).
From ThaiEmbassy.com (not the official website of the Thai embassy):
They must have a confirmed return ticket to show that they are flying out of Thailand within 30 or 15 days of entry, as appropriate. Open tickets do not qualify. Travelling overland out of Thailand by train, bus, etc to Cambodia, Laos, Malaysia (including en route to Singapore), Myanmar, etc is not accepted as proof of exiting Thailand.