1. Johan Sebastian Bach (1685 - 1750)
2. Wolfgang Amadeus Mozart (1756 - 1791)
3. Ludwig van Beethoven (1770 - 1827)
Bach was a predecessor of Mozart, and coeval of Mozart's teacher Salarieri. Bach's music is more balanced than Mozart's, and more 'mathematical' than Mozart's.
Bach is perfect. There are many musicians who can perform Mozart, but just a few who were able to perform 'The Goldberg Variations' of Bach.
Music is also a matter of taste, but most music connoisseurs agree with the above ranking.