Is the word "thing" used in the same way in the following two sentences?

A thing of the spirit.

A funny thing happened on the way to the ...
different meanings