Breasts are comprised primarily of fatty connective tissue. If you are very thin, then putting on a few extra pounds (i.e. fat) might help fill out your breasts. Note that all women carry their weight differently, so only use this method if you have a tendency to gain weight in your chest as opposed to your thighs, belly, or other body part.
It is important to follow a healthy diet even if you are trying to gain weight. Load up on lean proteins, healthy fats, and complex carbohydrates and remember to stay active.