As long as the marriage took place before the Primary received approval of the I-485, the spouse can file as a derivative of the EB case, generally as long as they file within 180 days of the Primary approval.
I say generally, because an H4 for instance, becomes out of status when the H1B holder receives GC approval. However, 245(k) allows up to 180 days out of status without compromising the ability of the derivative's I-485 to be approved. Once the I-485 is accepted by USCIS, they take the position that there can be no further status violation, since the person is then in a period of Authorized Stay.
As a "Follow To Join" application via Consular Processing, only the fact that the marriage took place before the Primary's GC approval would be important.
If the marriage takes place after the Primary receives approval of the I-485, then the only route is via F2A and an I-130.
The Definition of a marriage is given in INA 101(35)
This extract from the FAM adds more detail
http://www.state.gov/documents/organization/86920.pdf