Yup, I'm with Virginia on this one.
Sounds very much like a luxating patella.
Abby had stage 4 by the time I rescued her when she was 9.
She's 16 now and still deals with them in both her hind legs.
No X-rays are needed to determine if it is luxating patella. Just a little manual manipulation can diagnose it.
It's painful, for sure, but it's amazing how well our four-legged friends can adapt to physical difficulties.
In Abby's case, because the knees are SO bad, along with lots of arthritis and previous tears in her ACL, she gets Metacam daily to help with pain.
It's an NSAID (like aspirin for humans) and helps her feel better. There are days when there is no limping, and others when it worsens.
Maintaining a healthy weight is important, as is continuing a healthy exercise regimen.
Best of luck!!!