1) How to change a variable found in a parent object using a ray caster.
2) How to parent one gameobject to another game object (say, 1 cube to another cube)
3) How to make it so that the variable changed within the parent object, causes something to happen to the child object.
Specifically. I want to hit the parent object with a raycaster when I hit the correct button. Once hit, it will change a variable within that parent object between two states (1 and 2). In the first state, the child object will be visible, in the second state, the child object should be invisible.
1) How to change a variable found in a parent object using a ray caster.
once you have the GameObject found from the ray cast you can get the correct component of the object and modify it.
2) How to parent one gameobject to another game object (say, 1 cube to another cube)
transform.parent = otherObject.transform;
3) How to make it so that the variable changed within the parent object, causes something to happen to the child object.
In your example above you could get an object in the children object by doing something like this
use the above code to get the object fooParent then