How would i pick up and drop an item with raycast

I am a pretty Intermediate scripter in unity, but I am really new to raycasts.
But anyway, I would like to know how you could pick up an item up whit raycast.

This is what I am trying to do:
You look at the item while standing closeby it (in a small area)-> you press E → the item appears in your hand → you press E again → the item gets dropped on the floor.

The most steps looks pretty easy to me, but I have no idea how I would do the first one. Please tell me how I could do that in javascript.

var hit:RaycastHit;
var pickedUpObject:GameObject;

function Start () {
function Update () {
if(Input.GetKeyDown("   /*  ADD YOUR KEY  */   ")){
    if(hit.collider.gameObject.tag=="cube"){ //add collider reference otherwise you can't access gameObject!
} else {