I'd agree with winkie, but I'd reiterate that when you leave the beach, put your street clothes back on, don't just add a pair of shorts to your bikini or wrap a sarong round your waist.
At temples it's best to be covered quite a bit more. Spaghetti strap tops & shorts are not the best things to wear there. As a mark of respect, try to cover your shoulders & cleavage & wear something at least down to your knees. So a short sleeved t-shirt & trousers or cropped trousers would be OK. (I'm assuming you're a woman, as you can see!)
A little off the subject, shoes should not be worn inside anybody's house, in temple buildings or in certain shops or offices. If you see loads of shoes outside the door, take yours off too.
As a cultural aside (nothing to do with clothes) you know about the Thai taboos about heads & feet, don't you? And also, as a woman you're not allowed to touch or pass anything directly to a monk, should you be visiting temples.
Enjoy yourselves when you come. It's a great place!

"The question is not, can they reason? Nor, can they talk? But, can they suffer?" - Jeremy Bentham, philosopher, 1748-1832
Make a dog's life better, today!