The three words can be used to show a progression in knowledge and expertise. Let's say we are talking about driving a vehicle:
Familiarity implies a modest amount of experience. Some teenagers might be familiar with the controls of a car (i.e., they know difference between the brake pedal and the gas pedal, they know how to steer and use turn signals, etc.). They may even have some driving experience, but by no means would they be considered experts - not if they are merely familiar with driving.
Proficiency implies a sufficient level of expertise, to the point where the individual is trusted to do some sort of task. Some areas might have some sort of exam required, where people can demonstrate their proficiencies. In other words, you must demonstrate your driving proficiency before you can obtain a driver's license.
Mastery implies a level of expertise beyond proficiency. An instructor at a driving school may have mastery of the skill - not only is the instructor a good driver, but they can teach other people about the hazards of driving, safe driving habits, etc. They might also have had experience practicing, say, manuevering out of a skid.
The three words need not always be used in such a progresssion, but, when used together, proficiency always implies more expertise than familiarity, and mastery typically carries more clout than proficiency.
Put another way, if I was posting a job ad for a programming firm:
Must be familiar with C++ would mean that the person should have at least seen the language, and maybe even have written a few small programs in it.
Must be proficient in C++ would mean that the applicant should be ready to code with little to no special training, and should be very comfortable programming in that language, based on past experience.
Must be a master of C++ would imply that the programmer should be adept even with all the advanced features of the language, and would be a good candidate to mentor other programmers.