Unity 4 - Raycasting - raycastHit - detect Gameobject with raycast - C sharp

How to raycastHit?

Everytime i try to use I get errors.

for ex.

var hit =RaycastHit;

how to assign RaycastHit to a variable?

edit: it took me a while to figure out because I did not know how to construct the question (I got a real helpful answer from answers.unity... can't remember from who), but just in case someone manages to end up reading this by trying the same keywords I was, here is the answer.

you have to make a new RaycastHit and assign it like so

...
RaycastHit hit = new RaycastHit();

if(Physics.Raycast(myRay, out hit)){
//http://docs.unity3d.com/ScriptReference/RaycastHit.html to see list of variables that RaycastHit contains
var myVar = hit.transform.gameObject;
...

Go learn c# basics, its not place for asking basic c# questions.
After you learn its basics, check this - http://docs.unity3d.com/ScriptReference/Physics.Raycast.html and look for examples, there are examples using raycastHit.