<p>Do you actually have the option to take the course pass/fail at this point? There are usually time restrictions on those things. </p>
<p>Either way, you won’t have a problem regardless of what action you take. A B grade (or even multiple) will not hurt you unless you have a weak application overall. Continue doing well, get research experience (key), great recommendations and you will be extremely competitive. A 4.0 is great, but don’t think a 3.8 would exclude you from anything.</p>