If you're interested in seeing what's happening, fire up Activity Monitor and hit Sample on the app when you see the beach ball. It records the call frames of all threads a couple of thousand times over a few seconds, so you can see what that app is waiting for.
If the entire system has ground to a halt such that it's difficult to actually get to Activity Monitor to do the sample, then it's likely to be a memory problem. If it's just one app, it's probably something else.
If the system is hung such that you can't get Activity Monitor to sample, use command-option-control-shift-period to run sysdiagnose. Attach the resulting /var/tmp/sysdiagnose_$(TIME).tar.gz to your bug report.
And inside that tar.gz file is a spindump.txt file, which will have the samples of whatever application is spinning at the moment, just like if you used Activity Monitor to sample it.