PC Beeps sometimes

Hi, I am currently building a Gaming PC. I dont have an OS System on it yet but I do have the PC built. When I turn it on sometimes it will boot to the BIOS fine but sometimes it will do 1 Long beep and 3 Short Beeps and I know that is is a memory problem but what I cannot work out is why it works sometimes and other times it doesnt.
Can anyone please help with this problem?