When it comes to S-300 you should keep in mind that there are two
completely different systems that are called S-300: S-300V and S-300P. Most exported and famous is S-300P version.
S-300P has many very different modifications:
S-300P (1978) - 5V55K missile, 47 km range.
S-300PS (1983) - 5V55R missile, 75 km range.
S-300PMU1 (1993) - 4N6E missile, 150 km range.
S-300PMU2 (1997) - 4N6E2 missile, 200 km range.
S-400 is modified S-300PMU2.
Now when it comes to range most important thing to remember is that in order to guide missile this guidance radar must be in line of sight with the plane:
If plane is hidden by horizon or some mountain it wont be able to guide it. For example if plane is flying at 50 m altitude over a plain, then S-300 wont be able to hit it beyond some 25-30 km.