I was in a situation like this. Me and another junior developer had to work under a senior developer who repeatedly had to ask us for guidance, took all the credit for everything we did, and called us morons if we couldn't answer questions that he himself couldn't answer.
The other jr developer actually had a nervous breakdown due to the bullying and had to go on medical leave and the sr. developer eventually quit before he got exposed and went to another company doing the same thing (I know ppl there)
My advice in these situations is to stand up for yourself, DOCUMENT what you are doing and even any back and forth between you two (emails). If it's really bad maybe even set him up to fail by not bailing him out constantly. I was able to get the guy under control by threatening to not hold his hand on certain tasks that he had to complete under deadline, unless he changed his attitude