How many times has this question bothered you at work? I'm sure a lot many times. Well, don't worry. There are many other workers who have colleagues with the same experience, same skill set, same designation but a different package.
So the better question to think about is why does this happen? And what can you do about it?
The answer goes back to the time of recruitment. Generally, the previously withdrawn package makes a base for the new salary a candidate can expect to get in the next company. And then it is always one's own negotiation skills. Other factors can be the employer's need to hire the employee at that particular moment as well as the paying ability of a company. Howbeit, it's always a good idea to research the market benchmark before you accept the job offer as it's usually difficult to get any amendments done in the appointment letter once it is signed. This is why experts as well as HRs recommend employees to always go through all the documents like employee handbook, HR policies etc. carefully before accepting the job.
Now when you are already on board, never address the package disparities directly to the management. It may arise several counter-questions like "How do you know about your colleague's salary?" or "Do you know it's against company's policies to spy other employees salary?" etc. Know your company's practices before taking any step.
In case the salary discrimination still bothers you, prepare a good case for a salary hike at your next appraisal. Don't present the case as "because my colleague is getting higher". It should always be "I see myself as a potential candidate for a salary raise because of the values I bring to the company". Needless to say, performance is the biggest key that can create milestones. And no company wants to lose its potential workers for the mere sake of raising a few thousands.
All the best.