The command:
(command "RAY" "500,100" "400,500" "")

works for me. Make sure you do not have OSNAP on and that it's screwing things up! You can do it in vlisp with:
(setvar "osmode" 0)