The one coming from the bottom is more than likely coming from a receptacle and this is where your power is coming in. The one coming out of the top that has the black,white, and ground wire is controlling the light. The other cable coming out of the top is going to another light switch somewhere else in the house which allows you to cut on the light from another location. This is a "Three-way switch and light fixture with duplex receptacle" setup. Type that phrase into a search engine and hopefully you can find a diagram because it is pretty complicated to explain in words but fairly easy to follow as a diagram. This is more than likely the setup you have but I can't be sure because there are several ways to wire up all setups. The one from the bottom is probably the power wire, the black, white, and ground coming out the top is controlling the light, and the other cable is for a three way switch so if you can find a diagram to show you what to do with those three you should be good to go.