From what you are describing it seems more like your coworker is not as skilled at software development as you rather than just a slacker. They could be a slacker if they 1. Devote a large portion of their time to distractions or straight entertainment during work 2. Are unwilling to put in the time or go the extra mile when the project requires it or 3. Spend the effort to improve their (admittedly lousy) development skills.
If they are a slacker... Well it does not matter what you do, the problem will take care of itself. I am the kind of person who might consider giving them a short (polite as you can keep it) wake up call, some people need to get jolted awake and it could gain you an ally if you can convince them to be a team player.
It is possible that they are also truly incompetent and incapable of learning the skills they need. If that is true feel sorry for them because it does not matter how hard they try, they will be cut sooner or later
I am going to go with the assumption that "Bob" simply does not have the skills they need for the job. That is actually more common than you might think, a lot of times you want to hire the worker someone will become rather than the person they are (see any student out of college... ever). I would try to figure out why they were hired, dos Bob have a skill other than software development that no one else on the team has? Or some other facet that helps the team get a particular contract (you need someone who already has security clearance to get a contract that requires people with security clearance, so that you can apply for the rest of your team to have security clearance).
I don't know how you are sure he makes the same amount you do, not everyone in the same position does and most companies keep what they pay individual employees confidential. But if you can figure out the reason they were hired it could help with your morale problem. As to what you can do, assuming Bob is not lazy or an idiot I would provide some amount of help, and a whole lot of pointers. Recommend books, say things like "finding code on the internet works sometimes, but you need to move beyond copy/paste", explain good practices... straight up knowledge transfer.
The benefits are threefold. First, your team gains a true contributor. Second, you gain an ally in Bob. Third, your boss will notice and will value you more.
This relates to my personal experience, in one job I was Bob. I was hired as a software developer with limited programming experience (I had exactly one class programming in college, not in the language I was hired to write). The reason I was hired was that I did have a strong statistical background, which was an area the company wanted to grow in. So I did as much as I could on the projects I was given, I read, I watched Coursera videos, I Googled, I asked questions on Stack Exchange... Most of all I listened and learned from my coworkers. And I learned my stuff. In addition I made myself the go to person for statistics and mathematical questions. It worked very well, I was kept on despite the company not getting the contract they needed a stats person for, and our team was very amicable and very productive because we transferred knowledge between us when someone was trying to learn a skill.
Edit
There is another possibility. Bob may have misrepresented his skill set during the hiring process. The above answer assumes management knew that Bob would be training up and had a reason for hiring him anyway, if that is not the case then they should know about his lack of skills as soon as possible!