this is the exercise i was given for the piriformis muscle.
Back Exercises & Stretches : Piriformis Muscle Stretch - YouTube
if you want to stretch the right side piriformis, place your right ankle on your left knee, and lean forward.
in my case, another symptom of a spasm/contracted piriformis muscle is that the foot turns out. so, if i'm lying in bed on my back, my (good) left foot naturally points to the ceiling, without effort. but since my right side piriformis is in spasm/ contracted, my right foot naturally points to 2 or 3 oclock. after the stretching exercises, my right foot will again point at the ceiling.