Theory of resonantly enhanced multiphoton processes in molecules