Thais greet each other with the ‘wai’ (pronounced like the word ‘why’), placing the palms of their hands together as in prayer and raising them to the level of their face whilst bowing slightly. Cambodians and Lao people also do this but they don't bow their heads down. In addition to greeting and saying goodbye, the wai is also always used when either presenting or receiving a gift. The wai is, amongst other things, a mark of respect for position and age. For Thais, different levels of the closed hands can show different degrees of respect.
As a rule, if someone wais you, you should always wai back. However, it is not considered correct to wai children or to wai someone who is thanking you for your patronage. Thais are aware that foreigners don’t use the wai and in situations where you are unsure, a nod and a smile will always pass as an acceptably polite response.