Actually the reason why Floyd lands the right hand is for 3 reasons.
#1 - He throws it as a counter with the shoulder roll. He waits for his opponents to throw their own right, he rolls it and counter with the right hand. It's very effective because he "hides" the right hand in that roll.
#2 - He's very fast. Sounds simple but he is and it helps a lot.
#3 - His timing is great. Again, sounds simple but he can time you coming in, going out or counter you after your own right hand.
The only way I see to avoid it is to not lean, reach or step too much inside when attacking him. Obviously always move to your right as well and use what Cotto used and that's a great left hand jab as an orthodox fighter to force Mayweather on the defense. Cotto was able to land that jab to the face of Mayweather, keeping him off balance and forcing him to the ropes where he can follow with that right hook to the body.
The punch you don't want to throw against Mayweather from the outside is the lead right hand and from the inside is the left hook or left uppercut. You will be wide open for the counter right.