CSI 2264: Simultaneous optical and X-ray variability in pre-main sequence stars I. Time resolved X-ray spectral analysis during optical dips and accretion bursts in stars with disks