I had to remove virtual/pam today as part of the Gentoo FreeBSD removal, as it is masked. See bug #697630. Unfortunately this will cause your next emerge to fail, as many of the things you've installed may have a dependency on virtual/pam and not sys-libs/pam, and it will want you to unmask virtual/pam to resolve it. Perhaps if you force emerge to backtrack far enough it will come to the right conclusion. Rather than attempt that, I decided to rebuild everything that depended on virtual/pam, just to keep these boxes clean:
# qdepends -q -Q virtual/pam | cut -f1 -d: | sed -e 's/^/=/g' | xargs emerge -1
This was easier than finding out which things were blocking emerge one-at-a-time.