Originally posted by Paleo Pete Ira is right, non A series PK lenses (K and M) will not work right in aperture Priority mode, because the camera has no way of knowing what aperture you're using.
For another layer of confusion: a K- or M-series lens from Pentax has an aperture stop-down linkage flag on its base. This does not engage when in Av mode. In M mode, the Green button DOES engage this flag, giving stopped-down metering and exposure.
But many third-party PK (Pentax K-mount) lenses do NOT have such a linkage flag. These act the same as an M42 screwmount lens on a adapter: the camera simply uses whatever aperture you set. No need to press the Green button! But stopping down below f/11, the viewfinder looks mighty dim...
The slight inconvenience of using M- and K-series and flagless lenses helps drive up prices of A-series manual-focus lenses. All newer series (F, FA, DA) are autofocus and auto-aperture, and don't suffer such mechanical limitations, nor suffer Shake Reduction (SR) communications problems. But that's another issue.