has he jumped or landed funny when out on a walk or in the house.
when did you knotice it.
have you had a feel at his leg to locate if its his paw, joint, muscle, or ligament.
if he is really in pain it might be an idea to head to the vets in the morning.
it could be he has twisted something or it could be the start of someone arthritis or joint problems.
magnetic collars have also been seen to reduce discomfort in dogs with joint problems.
hydrotherapy is also good. if he is a small dog you can fill up your bath with some warm watter, most dogs have a natural swimming reaction to watter. if you hold him in the watter he should start to kick his legs trying to swim.
let us know how you get on.