There has been a spelling debate going on in Thai for some 4 years now. It's over the proper spelling of the word pronounced [มุก-ตะ-หลก]. See how I avoided using either of the spellings there? That's right, I went phonetic. Fancy. The two spellings in question are มุขตลก and มุกตลก. If you're not familiar, it's a noun phrase meaning a joke or gag. Something, usually spoken, intended to make folks laugh.
First, let's make it clear that prior to 2003, มุขตลก seems to have been the largely unchallenged popular spelling. It appears that the cause of all the subsequent fuss is Thailand's Royal Institute. The word first appears in the Royal Institute Dictionary in the 1999 edition, published in 2003*. It gives the spelling is given as มุำกตลก. And if it were any other dictionary, the debate may never have taken place. But as the government's official dictionary of Thai, there was a clash between the commonly accepted spelling and the etymologically correct spelling selected by the Institutes committee of experts.
Part of the reason this has taken so long to resolve is due to the methodology of the Royal Institute in compiling its dictionary. They work on each new revision of the dictionary at a snail's pace. Actually, probably slower. For more than 70 years now, the Royal Institute has been using the committee method, where a group of 10-20 experts with busy lives and other jobs and commitments get together a few hours a week to crank through a few words. They've published editions of the RID in 1950, 1982, and 2003.**
The meeting during which the RID dictionary committee decided มุกตลก should be spelled with the letter ก. ไก่ instead of ข. ไข่ happened in 1985. Math time: 2003 - 1985 = 18. It was published 18 years later, and the committee had changed significantly in that time, so that basically all of the people who were on the committee at that point were no longer on it by the time it was ready for publication.
So let's talk etymology. The case for มุขตลก with ข. ไข่ is that มุข in this case means หน้า (face), which traces back to Sanskrit mukha meaning the face, mouth, or front. And so the story goes, that in former times, a comedian could make many humorous faces, and so "(funny) face" came to mean "gag/joke."
While a convenient explanation, this smacks of folk etymology to me. I have yet to see any evidence that it developed from this meaning. In the earliest clear uses of มุก/มุข, it's already being used in the sense of a joke or gag. These occurrences date back around 100 years. The textual evidence shows both spellings--มุข and มุก, but this isn't surprising because it appears to have been a colloquial term and shows up in written form only in plays. The compound word มุกตลก/มุขตลก doesn't appear until more recently, and between the time that this compound became common and RID 1999 was published, มุขตลก became the commonly accepted form. So, in fact, the confusion over มุข or มุก predates the compound.
The Royal Institute gives another etymology. They maintain that it has nothing to do with mouths or faces, and that it's a native Thai word--which means the ข in final position isn't etymologically correct, since that would indicate Indic origin. Their claim is that it comes from โม้กิ๊ก, โม้ meaning to fib or (this is still a common word), and กิ๊ก being onomatopoeic for the sound of laughter***. So this would have been a verb meaning to fib or play a trick on for the purpose of comedy. The RID etymology theory goes that as a colloquialism, it was not frequently written down and went through a rapid sound change to become มุกกิ๊ก, which was shortened to มุก, and switched parts of speech to be used as a noun.
A lot of people still consider RID in error, and many probably don't know but just follow the majority, but there are also plenty of folks willing to follow RID. Googling the phrase เล่นมุก returns 22,000 hits, and เล่นมุข returns 60,000. So both appear to be alive and healthy.
The Matichon dictionary parts ways with RID on this one, giving only the spelling มุขตลก--probably because of common usage, since they claim to be a descriptive dictionary.
So this leads us to ask: does it matter if the spelling is etymologically accurate? It's possible the RID will include มุขตลก in its next edition, since they're not entirely immune to public opinion. Sometimes popularity wins out over etymology. (For example, the word อัตโนมัติ "automatic" etymologically should be อัตโนวัติ, to have the correct meaning from its Indic roots, but its English counterpart is phonologically similar enough that the public got used to the ม version, which is now accepted as correct everywhere.)
Personally, I think the RID origin account is more reliable, since there is textual evidence to show the development from โม้กิ๊ก to มุก, and since they are used in the same meaning. But on this matter, I'm sort of ambivalent about what I'll actually use myself. As it happens, I'm not writing a dissertation on joke theory or anything like that, so I can describe both sides of the argument, then sit back and let them duke it out on their own.
It's all just a joke to many folks, anyway.
* It is called RID 1999 to associate it with an auspicious year--the king celebrated his six-cycle, or 72nd, birthday that year. The previous edition is RID 1982, the 200th anniversary of Bangkok's traditional founding date.
** Now, I know it took more than half a century to complete the Oxford English Dictionary, but that was worked on by thousands of volunteers, a significant dedicated staff, and was actually a respectable piece of lexicography. For the number of years between volumes, the book is basically inexcusable. It is good in some aspects, better than almost everything else available (although it could learn a few things from Matichon), and certainly better than nothing, but it is to dictionaries what the FBI's insanely expensive computer system is to computer systems. Very poor cost-benefit ratio.
*** This is my own analysis of โม้กิ๊ก, so if I'm wrong, please correct me. There are a number of ways to convey the sound of laughter, but using ก as both initial and coda is common. หัวเราะกิ๊ก gets 524 Google hits, หัวเราะกั๊ก gets 35, and หัวเราะก๊าก gets more than 14,000. I can't chop of the หัวเราะ, unfortunately, because independently they have many possible meanings which would render a Google search meaningless.