Thai people have rather a strong idea of their personal space; not only do they consider patting on someone else's back or shoulders quite rude but touching one on the head is also considered pretty insulting. For greeting purposes and also as a means of conveying respect, Thai's use a wai, which is a gesture made with hands by placing your palms together in a praying position. However, three different types of wai greetings are used for people of varying statuses. If you just want to wai to a person of a similar status, however, the wai should be made by lowering your face until your nose touches your index fingers (when your hands are in praying position, of course!) As a foreigner, you will not be expected to initiate a wai, but it'd be great and appreciated if you do! However, it would be prudent to refrain from initiating a wai if you're unsure of its correctness.