That is the quads and hamstrings...
Did your dog sustain an injury? Hit by car? Do you ever see him put weight on the leg?
The tend to get cruciate damage (knee) but I don't usually see swelling of the actual muscle. The other thing is a luxated hip...and the positioning they hold the leg in might make it look swollen.
You can use a regular strength aspirin (with food to avoid stomach upset) every 8-12 hours for pain...but you probably will need to have a vet take a look at it.
There are ligaments within the knee that keeps the joint working. Sometimes they rip (football players and skiers get it the most) and require surgery. There is pain in the joint and toe tapping and keeping the leg up. It is common in bigger breeds like Rotts.
A luxated hip is very painful if you move the leg in a normal movement ...but it is where the hip pops out of joint..usually from an injury.
I just am trying to think of common reasons for hindend lameness. The swelling can come from bites (bee/snake/etc) or injuries but not usually just on the top of the leg...it is usually the foot.