How much extension of the leg do you get? The old way to check this (I think there are now other approaches) was to have someone hold the bike (or have it in a stand) while you sat on it and pedaled backwards with your heels on the pedals. With this setup your legs should be fully extended at the bottom of the stroke. Then, when you place the balls of your feet on the pedals, you will get the slight bend in the knee at the bottom of the stroke that is "just right".
Are you using toe clips or "clipless" pedals? Most of the time using toe clips will help knee pain somewhat (though for some people the opposite is the case).
But you should see an orthopedist and have some exercises/stretches prescribed for the knee. The proper exercises will likely provide an order of magnitude improvement in your pain situation.