If I'm going in the same direction and get stuck behind one, I take an alternate route if I can't pass. My grandmother refused to pass a procession because "rushing ahead of a hearse is too much like rushing to your own grave." If I can pass, I pull on my headlights as I do so and, as I pass the hearse I put my hand over my heart. Don't know why. If I'm approaching an oncoming procession, I pull on the headlights as I go by. Again, don't know why.
Police funerals, because my family on my mother's side was mostly San Jose Police (while my father's side of the family were gunslingers and outlaws!), are a little different. I grew up around cops, and my uncle was the Assistant Chief of Police, SJPD. Although I know plenty of cops can be assholes, I also know for a fact that there are a lot of good guys behind those badges. So for police funerals from any town, especially when they stop traffic to let the humongous procession cross traffic, I pull on the headlights, shut the car off, and get out, placing my hand over my heart (assuming traffic has actually been stopped, of course).