Well, actually they cannot married with visitor visa but many did it and she can adjust her status after they get married.
There are few factors that BCIS (previously known as INS) will see when ppl get married with visitor visa (B1 or B2). Whatever it is, she have to proof at the BCIS when they have interview later on that the marriage is NOT PLAN. It happened like 'spur of moment'. This is a long story

...I will make it short, just about the marriage okay.
1. Get married
2. Fill in the following forms:-
I-485
I-864
I-130
I-693
I-765 (EAD, if she want to work - optional)
I-131 (Advance Parole, if she want to go out of US while her status pending)
I-765 and I-131 are optional. You can get this forms either in this site (fillable forms or in the BCIS official website).
Sure it will be a long way, but keep reading and gain knowledge of how to do it 'right at the first time'.
Good luck.
I'm not a lawyer, act accordingly.