It is normal to feel pain from stretching especially if you are tight and inflexible. A difference exists between pain from stretching and pain from injury so pay attention! You can alleviate or lessen pain during or after class by making sure your alignment is correct in poses and focusing on stretching the correct muscles. You will find that with correct form you will require less exertion in the pose. Ask your teacher to help you identify a problem in your execution or form.During class it is important to meditate and reflect in the pose you are performing and keep in mind that yoga can release emotional pain.
One last important precaution is never take painkillers before yoga class! They block our pain receptors that prevent us from feeling what’s going on within and we lose our mind-body connection.