to get an object to face an object
SetObjectLookAt ( objID, x, y, z, roll )
where x,y,z would be the other objects position
to then face the opposite direction or face away from it
RotateObjectLocalY ( objID, amount )
if thats what you want to do
the raycastfunctions are for determining if a collision has occurred