raycast DrawLine wrong direction, please help

hi. i have a basic code in java, to shoot in a game using raycast
and all the code works great, but when i try to draw a line when shoot in editor
the line appear in other direction…
please how to fix this on line 27 on my code.
please help… thanks a lot.

 var Effects: GameObject;
var initialSpeed = 20.0;
var TheDamage = 100;
var projectile: Rigidbody;


function Update () {

    var hit : RaycastHit ;
    var ray : Ray = Camera.main.ScreenPointToRay(Vector3(Screen.width*0.5, Screen.height*0.5, 0));

    if (Input.GetMouseButtonDown(0))
    {

    GetComponent.<AudioSource>().Play();

    var instantiatedProjectile : Rigidbody = Instantiate (projectile, transform.position, transform.rotation);
    instantiatedProjectile.velocity = transform.TransformDirection(Vector3 (5, 0, initialSpeed));

        if (Physics.Raycast (ray,hit,100))
        {
        
            var particleClone = Instantiate (Effects, hit.point, Quaternion.LookRotation(hit.normal));
            Destroy(particleClone.gameObject, 5);  // espera 5 segundosay destruye
            hit.transform.SendMessage("ApplyDamage", TheDamage, SendMessageOptions.DontRequireReceiver);
        
            Debug.DrawLine (ray.origin, hit.point);
        
        }
    }


}

by the way …
how can I draw a line rendered in the game please ?
thanks

please help
thanks