B&G Foods has entered into an agreement to buy the spices and seasonings business of ACH Food Companies, a US arm of Associated British Foods.