I have a ceiling fixture with three wires coming in to it one is hot, one goes to the wall switch one goes to the next room to a light switch. I need to know why would one black wire went straight to the light from the wall switch and the white wire from the wall switch went to the black hot in coming wire.
What you're describing is known as a "switch loop". A cable runs between the switch box and the fixture box, which is used to interrupt the ungrounded (hot) conductor.
Basically, power comes into the box on the black wire in the "feed cable". It travels along the white wire in the "* switch cable*" to the switch, then back from the switch on the black wire in the "switch cable" to the fixture.