For some people gaining weight is close to impossible. You wake up and eat, go to work and eat, come home and eat and you keep weighing the same. The simple solution is that you need to eat more. The equation for gaining weight is: calories eaten must be greater than calories burned. If you stick by that equation you will gain weight.
Your first step is to figure out how many calories you burn each day. You can use the Calorie Calculator. Remember that this calculator gives you an estimate. It'll take a week or two for you to get a better number. After you've used the calculator, 500 more calories than you burn each day. For example if the calculator estimates you burn 2000 calories per day, you need to eat at least 2500 calories to gain weight.
So now we come to the main problem. If you're eating 500 calories over what you burn each day and still haven't gained weight by the end of your first week, then the calculator underestimated your metabolic rate.
Everyone is different and some people have a faster metabolism than others. The solution is to eat more. Try adding 200-300 more calories in each day and check again at the end of the week if your weight has changed.
You may need to repeat the above step for a few weeks before you do start to gain weight. You can also make a huge step up in calories (example: going up 1000 calories instead of 500 during the first week). This will help you gain weight faster but you risk gaining more fat stores than muscle weight. This shouldn't be too big of a concern if you are the type that has trouble gaining weight (since you probably have a pretty fast metabolism).
Don't use the excuse of having a fast metabolism to eat any food you want. Even skinny people should worry about their health.
You want to fill your diet with healthy foods such as complex carbohydrates (brown rice,whole wheat breads, fruits and vegetables), unsaturated fats (mostly vegetable sources such as oils, nuts and veggie spreads) and lean sources of protein (fish, eggs, poultry and some cuts of beef). Since you are trying to gain weight don't be afraid to occasionally consume some "junk food".The Bottom Line
Remember that gaining weight takes time. You have to be consistent with your calorie intake. It's sometimes easy to skip a meal but when you're burning calories from exercise on top of a fast metabolism, that one meal could be the difference between gaining and losing weight.