Some cameras are notoriously finicky about brands of SD cards that work properly in them. I would find a good Pentax K-X support forum and do some reading.
A lot of people consider PnY cards to be "low hanging" fruit in the memory food chain. I tend to disagree in that I've had pretty good luck with PnY's stuff generally over many years, but I admit I don't have any of their SDHC cards (if I do, they're small and long since "retired").
You could have some bad contacts inside the camera but things like that are really jumping out on a cliff.
My suggestion would be to go buy a "high end" SDHC card like maybe a SanDisk or Transcend and see if you have the same problems with those. They are somewhat reasonable and generally available at BestBuy and Staples type stores nation-wide.
It should be noted that the SDHC spec supports cards up to 16G but it is known that some devices do not properly support beyond 8, despite their claim to be within the spec. I seriously doubt that's the case with the K-X, given its reputation, but I shoot Canon so this is not really my area of expertise.
There are Pentax shooters here on the forum and specifically K-X shooters. Hopefully, some of those guys will chime in here and give you a little more help and what I can and have given you is very general, at best.
Good luck.