I wonder whether it would be possible to mount Pentax lenses on a Sony NEX, using an adapter. Are such adapters already available? Would it be possible to have automatic focus?
Yes, they're available, from several sources. Two notable ones are:
There are also versions available on eBay from various sellers, but I have no idea about reliability or quality of those. Rayqual and Cosina are both long-time manufacturers with pretty good reputations.
Autofocus will not be possible. AF systems aren't necessarily compatible to begin with, and the connection information isn't available to third parties. The best situation for most adapters is focus confirmation.