My friend actually had a similar problem sometimes one of the ram pieces can get broken jarred out or loosened you can....
- try a PRAM reset
- press and hold down Command + option + p + r keys right when its turning on
- wait till you hear three chimes
- then release and see if that works
- check to see if one of them has physical damage
- if one does remove it and restart the computer see if it works normally.... P.S. sometimes even though they look okay try it with each one sepeartely to figure out which one is causing a problem