Does Time Machine have a separate phase just for encryption? I'm making an encrypted Time Machine backup for the first time. I had assumed it would encrypt the data as it was writing it, but now I see that (after leaving it alone for several hours) the Preferences pane for Time Machine shows a progress bar with the word "Encrypting…". Does that mean it writes the backup in cleartext and then encrypts it all in a separate phase?

I'm using 10.9.5.
I assume you're backing up to a directly attached drive (USB drive or something similar)? When you select a local drive for encrypted backups, it converts the entire drive (or at least the volume you selected) to encrypted format, then starts backing up your data into it.

Basically, it's encrypting the current contents (probably most blank, but it encrypts blank space as well). Once that one-time conversion is finished, it'll start backing your data up, encrypting that as it goes.