You already received some good advice. The grainy effect is the result of High ISO to compensate for the limited light and need for high shutter speed.
A couple of suggestions come to mind:
- Have you tried some simple PP? I could recommend Noiseware. You can download it for free and it does a good job. (The freeware version cannot do batch processing and a few things, but it is as good as the paid version.) I use Noiseware and I can recommend it
- Have you set High-ISO correction in your camera? Adam showed a nice trick with the K-7 by forcing the Max ISO to a lower value (ISO 800?) and forcing the High ISO correction. The results with a K-7 were excellent even in deem light. I would suggest to play with the High-ISO correction similarly with your K-x to compensate for your low aperture lens.
Hope that the comment will help.