Taking it in a slightly different direction; M-42 is a threaded mount (screw mount). K is a bayonet mount.
Many or perhaps almost all M mount Pentax lenses have a metal focus ring and an all metal body. Focus operation across almost all M models is buttery smooth - akin to $2k and $4k Leica lenses or even better. They feel very high quality in the hand and mounted on the camera.
Most or all K mount Pentax lenses use a rubber focus ring. The aperture ring is always stiff and unsmooth unless it's nearly worn out. Focusing operation is not very smooth - nothing at all like the M mount lenses. Pretty much the same as MF Nikkors, non-L canon FD, or Oly lenses. Actually Oly is often a little smoother. They don't feel all that high quality in hand nor on camera - but pretty average.
In terms of IQ most M mount pentax lenses have a very creamy and "painterly" bokeh. There are five general kinds of M mount pentax Takumars: Takumar, Auto-Takumar, Super Takumar, SuperMultiCoated Takumar, and SMC Takumars. Almost without exception the coatings are:
Takumar - Single Coated
Auto-Takumar - Single coated
Super Takumar - 3 coating layers
SuperMultiCoated Takumar - 7 coating layers
SMC Takumars - 7 coating layers.
I think it's 7 anyway but it's been awhile since I read it so it might be 6 or 8 - but I think I'm remembering right that it's 7.
Many, perhaps most Auto-Takumars and Takumars have a noticeable amount of color fringing (LoCA, etc.) tho usually not too much purple fringing (PF) around high contrast edges. IMO the way it's rendered in the image it actually adds to the character of the lens - most are still very sharp and the OOF color gradient fringes make them all the more painterly. Flares are very defined and pronounced - which can be a very nice effect!
Super Takumars are about the same thing but less (almost no) PF and flares are less defined and pronounced.
SuperMultiCoated Takumar are about the same again but much less LoCA and flares are dead and dull like most other multi-coated lenses. Lens reflections are about all that's left for using flares creatively.
SMC Takumars begin to use rubber focus rings and inferior dampening grease - very near to K mount pentax models. IQ is very slightly different than SuperMultiCoated Takumars.
With K-mount lenses they started dropping the Takumar insignia. "Takumar" was the name of Asahi's Founder's brother: Takuma Kajiwara. He was a little famous for his oil and acrylic portraits (paintings). And since the early Takumars uniquely rendered a "painterly" bokeh the name seemed to apply very well. By the time SMC and K-Mount lenses were being made this painterly rendering was gone and so it seems fitting that the painter's name was dropped as well. Later in some Ka-mount lenses the Takumar name was used again as the lenses they applied the name to were designed to recapture that painterly look. Whether they actually do recapture that look or not you'll have to buy one and find our for yourself.
If I wanna be creative Takumar and Super-Takumar are preferred. Very much preferred! They look pretty awesome mounted on the camera too! If I want good, standard or typical looking, vanilla photographs then I use one of my SMC Takumars or one of my SMC Pentax K-mount lenses. I have a few Ka-mount Takumars too but haven't used them enough to really comment intelligently.
If you wanna know about the various series of lenses they made from about 1975 or 1980 (after K) then wiki is a good source:
http://en.wikipedia.org/wiki/Pentax_cameras#K_Series IMHO, there's nothing significant between them - various qualities and many attempts at AF and then on to Digital. Not of much interest for me. I like MF lenses.