People often experience knee pain while doing squats because they are not aligning their body correctly while performing the squat. If you are doing it correctly then your thighs should be just below knee level at the lowest position of the squat. Adhering to this rule will help you to get rid of the knee pain that you might otherwise feel.
Another thing that can help is if you get used to squating without using any kind of weights before adding weights to the equation. Build up your strength first squating without wieghts and then work your way up to using them.