macbook beeps 3 times

Couple of days ago my macbook freezed and started beeping thrice, I imeediately googled it and found out it was bad RAM but couldn't find the cause. I want to buy a cheap RAM-"Transcend 4 GB DDR3 1600Mhz" but I am not sure that if macbook supports this. Please suggest.