Let it be a secret
If you share your compensation details with your colleagues and friends you may be running a risk of alienating many of your peers when they come to know that you are paid more for what they think to be the same job. Generally, companies have different employees on the same job, but may not pay them all uniformly. The salaries are paid according to their seniority or performance.
Democratic functioning won't click at the workplace. It is better to keep your salary a secret. Your manager gets an opportunity to have confidential discussions with the staff to explain why they are paid so. He may even show you ways to earn more. Each employee, in such a situation, can move forward with confidence as he can share his individual issues with his supervisor without drawing the attention and ire of others. He in turn can positively point out your strengths and weaknesses.
Don't panic
If you come to know your colleague who is in a similar position as yours earns more than you, don't lose your balance and become hyper. Try to know whether you are underpaid in general. Browse the Web to know how others with your qualifications and experience are paid in your industry. Then go to your boss or supervisor and have a rational discussion with him to know the reasons for differential salaries. You may also seek his advice on the areas you need to improve and how you can better your performance, earn recognition and go up the ladder.