Leaving a hot wire in the wall or ceiling
You must terminate the wire in a box and it must remain accessible with a cover plate.  You need to terminate it with the appropriately sized wire nut.  

This may help locate the hidden splice:  get a voltage sensor ($5), turn off all breakers except for this one.  Put the sensor on high sensitivity and start sweeping around on the ceiling.  You might get lucky and find a hidden box or at least you'll get to know how the wires are run and get a better feel for which switch or light box contains the feed.