You didn't mention if you're working in 2D or 3D, so I'll assume 2D:
var collider = $RayCast2D.get_collider()
collider.material.set_shader_param("outline_color", Color(1., 1., 1., 1.))
That assumes your shader has a parameter
uniform vec4 outline_color
that you're using to set the outlines color.