Arduino get data from Wall light switch

I tried to put in the one end of the switch the arduino pin 9 and the other end the ground.
When the switch is on i receive in the serial monitor 0 but when it's off I receive random ones and zeros. I haven't added any type of resistor if I add one toy think that it will fix the problem? if yes what type of resistor will do the job?