A speaker and a microphone both work on the same principle. They're dynamic transducers with the only differences being that they're designed for a particular application. For a speaker to work as a microphone, you just have to wire it like a mic and feed it into a microphone preamp like you would with any other microphone.