Hip joint pain in yoga poses can occur in deep forward bends when the chest is close to the thigh or vice versa.
The feeling can be like bone against bone or as if the hip joint is being compressed.
One simple solution is to focus on creating space in the hip joint.
If your knees are straight you can start by pressing your feet away from your pelvis. Imagine pulling on a tight pair of hip boots. Push your foot outwards away from the hip joint. Or imagine pulling on super tight jeans. But not too tight.
Once you get the action (and if you pay attention and do the action slowly you'll notice tension in the butt or inner thigh or outer thigh) you may also notice that it seems as if the head of your femur is moving slightly away from your hip joint, then try it with the knee bent.
In this instance try moving or pushing the knee away from the hip joint.
Generally when first teaching this action I'll have students lengthen the leg and then lengthen the spine and then relax, just to help get the feel for the action.
I go over the why of this action and what causes it in my hip joint anatomy article.
Basically you are learning to use your obturator internus and gemellus and perhaps in a forward bending situation, the obturator externus.
It can be overdone, and I've overdone it to the point of including the movement in every pose during a routine and then what happens is an unpleasant feeling in the hip, exactly as if I'd overdone it.
So I'd suggest practicing to the point where the original hip pain is no longer there.
Note that in a pose like this seated hamstring stretch, where the arms can be used to pull the leg into the hip socket, I'd suggest reducing arm tension, modify it so that you use the arms to help lift the leg without pulling the leg into the hip socket.
Create space in the hip joint while inhaling, then gradually add tension to the arms so that you pull the leg into the hip socket.
This then strengthens the muscles that create space in the hip joint.
With enough practice of this technique over time you may find that you can use your arms to pull the leg into the hip socket and the muscles that create space are strong enough to resist the compression.
In poses like marichyasana or ardha Matsyendrasana you may have some slack muscle or connective tissue and when you go into an extreme position that connective tissue gets caught between thigh and pelvis (at least that's what it felt like to me.) And so a possible solution is using muscle tension to pull the slack tissue out of the way.
In a posture like matysendrasana or marichyasana c you can try activating the quadriceps.
The idea in so doing is to help pull some of your connective tissue out of the hip joint.
Or try pressing the knee inwards and then resist so that you activate the inner and outer thigh simultaneously to stabilize the hip, and as mentioned, help draw any loose tissue out of the way.
You may also find that it helps to adjust the position of the pelvis. If your left leg is on top try moving the right side of the pelvis back a little (turn the pelvis to the right) so that you create space.
You could also work at creating space (and length) in the torso. To do so draw the lower belly in. Then draw the backs of the kidneys up, away from the pelvis. Try emphasizing one side then the other.
Lifting the backs of the kidneys (or if you like, the bottom/12th ribs) activates some fibers of the respiratory diaphragm and pulls up on the uppermost fibers of the psoas muscle (at least that's my understanding of what happens.)
The feeling is different than that of pulling up on the back ribs (which uses the Levator Costarum muscles.) When pulling up on the backs of the kidneys it feels like the support is coming from deep within the body.
Activating the levator costalis, the feeling is more external and can involve all of the ribs (where pulling up on the kidneys only seems to involve the lowest pair of ribs.)
If you get pain in the hip joint in standing poses like pyramid pose/parsvottanasana or revolved (twisted) triangle, where you are bending forwards with the leg straight, a sequence of actions that can be used to stabilize the hip are as follows:
For more on hip joint pain, in particular at the front of the hip joint, read Anterior Hip Pain