This is called "Mamemaki (豆まき)"
For the family events, one of person wear "Oni men" which is the devil mask to be Oni. Lest of family throw Oni soybeans with "Oni wa soto."
When there is no Oni, you throw soybeans outside of your house from the gate with "Oni wa soto (devils out)", then throw them inside of the house with "Fuku wa uchi (Lucks in)."
After throwing Mamemaki, you eat a specific number of soybeans, which is your age + one.