There is nothing wrong is taking up the offer B, if you feel that offer B gives your more oppurtunities and promising for your career growth. The simple thing to do is to drop in a mail to the concerned person in company A giving him a candid picture as to why you have decided against offer A. But disclosing the offer B may not be a great idea as the company A might start negotiating with you in terms of salary etc so as to retain the offer. If this negotiation happens then it would like you a bargain and it would in compromising your career for money.