I have an object with a sphere collider on it, is there a way to get the specific direction of the object that entered the collider to put into the direction parameter of a raycast?
Transform have InverseTransformPoint method. It is what you need, i think.
float relativeX = this.transform.InverseTransformPoint (other.transform.position).x;
if (relativeX < 0.0f)
{
//Other came from right
}
else if (relativeX > 0.0f)
{
//Other came from left
}