Beans, like all other seeds, need moisture to germinate. As the bean seed absorbs water from the soil, chemical reactions take place within the seed. These reactions tell enzymes to start using the seed's stored energy to produce primary structures for the seedling. Sunlight is not needed for any of these processes.
The first structure that emerges from the germinated bean seed is a primary root called a radicle. The radicle extends into the soil. As it does so, a hook forms where the radicle attaches to the bean seed. Again, no sunlight is needed for this to happen.
At this point, the bean seed is still partially in the soil, the radicle is growing longer and becoming a true root and the hook continues to lengthen as it pushes from the soil. Up until now, the seed has needed no sunlight. Once the hook emerges from the soil and senses sunlight, chemical signals within the hook tell it to straighten. As it straightens, the seed is pulled from the soil. Without sunlight, the hook will not straighten. Although the bean has germinated in the dark, it doesn't truly sprout until the hook meets sunlight.
Once pulled from the soil, the bean seed opens and sprouts two primary leaves. These leaves begin to produce energy for the seedling by using sunlight. The hook straightens further to become the stem. Eventually, the seedling grows into a full-grown bean plant.