The spatiotemporal master equation