You can apply a small-signal square wave and look at the overshoot, there are diagrams**) from which one can read approximate phase margin from the amount of overshoot. This is tricky sometimes and can lead to wrong conclusions, e.g. when you run into hard slew-limiting (which actually opens the feedback loop for that moment).
In Spice, with a typical op-amp style topology (voltage I/O), you can bode-plot Vout/Vdiff (Vdiff: differntial input voltage) using an .AC analysis, or use some of the more sophisticated loopgain probe techniques (in LTSpice, see loopgain.asc & loopgain2.asc in the examples section).
There was a time at which you could purchase an HP 3575A Phase-Gain meter for a couple Jeffersons. The one I purchased had an analog output proportionate to one of the two variables plus pen lift so you could output the data to a data-logger.
Intersil has a neat method on their website using some CFB opamps -- I have done this and it works very well -- the HFA3102 dual long tail pair is a little difficult to obtain however -- you can use one of the fast comparators from Analog Devices or Linear Technologies, or make a discrete fast comparator, the results will be good enough for phase margin/ phase gain measurement for audio applications. The output signal is a DC value linearly proportionate to phase.