That sounds like THE SILENT FLUTE aka CIRCLE OF IRON with David Carradine and Sir Christopher Lee.
Either that, or by the sound of the plot, it sounds like it might be some old Shaw Brothers movie, as they usually defied the metaphysical to do mortally impossible things, as well as making it damned entertaining and fun to watch