pain

in my right hip socket and knee, it kills, even after extensive stretching, but just at night, but the next morning feels loose and great. what is this?