If I understand your problem correct you must work with 3D coordinates to find the solution. For sake of sanity the wall should be the z-plane with zero value. It comes down to some 3D-vector mathematics.
The mathematical theory is explained in this
Intersection of Lines and Planes and extended in
Intersection of Rays and Triangles.
Eventuelly you find in this
article some ideas of what you need.
Pay attention to properly check for edge and error cases like the divisor getting zero or the signs (direction of the vector).