Change raycasting

I have two planes one above another. The raycast is hitting on the first plane on top. Is there anyway to let the raycast hit the plane behind the first plane after certain condition have bee made?

You need to use Physics.RaycastAll and then work through the hits. Note that you might have to sort the collisions as the order is not guaranteed.

Alternatively you could change the layer of the first plane when the conditions have been met and exclude the new layer from the original Raycast.