Correlation between out of phase signals Say I have a numeric sequence A and a set of sequences B that vary with time.
I suspect that there is a relationship between one or more of the B sequences and sequence A,  that changes in Bn are largely or wholly caused by changes in sequence A.  However there is an unknown time delay between changes in A and their effect on each of the B sequences (they are each out of phase by varying amounts)
I am looking for a means of finding the most closely correlating B to A regardless of the time delay.  What options are available to me? 
** EDIT **
The crux of the problem here is that I have millions of B sequences to test, and there are approx 2 million data points within the lag window that I would like to test over.  Working out a correllation for each B for each possible lag scenario is just going to be too computationally expensive (especially as in reality there will be a more dynamic relationship than just lag between A and B, so I will be looking to test variations of relationships as well).
So what I am looking for is a means of taking the lag out of calculation.

You can find the lag more efficiently by using the Fourier transform.  The operation of cross-correlation of A and B in the time domain is equivalent to convolution of A with time-reversed  B, which can be efficiently computed in the frequency domain using the convolution theorem.  The cross-correlation is given by $F^{-1} \left\{ F\left\{A\right\} \cdot F\left\{B\right\} \right\}$, where $F$ represents the Fourier transform, and $\cdot$ is pointwise multiplication.
But, as you say, you're not really interested in the lag per se.  Instead, you want to know how much of $B$ is (linearly) caused by $A$.  The answer to this problem is Wiener Filtering.  
You may also be interested in computing the transfer function and coherence in the frequency domain.  A good book on such methods is Random Data: Analysis and Measurement Procedures by  Bendat and Piersol, though this particular book might be overkill for your needs.
