as far as your boss has decided to favor this other person, there is nothing you can do about it. I would agree with other posts here that you have to do what your boss told you to do. (Maybe put sth in writing as a record to make sure you will get some credit. But honestly that would not help. In big boss' eyes, as far as the job is done, he would not care who and how it is done.) Whoever is responsible will get the credit. At the same time, look for other positions if you do not think you have real career in your current position.