1. Solar energy will never give out.

2. Solar energy will never run out.
(Are both the same?)

3. We bought many foods.
4. We bought much food.
(Which one is right? Are both OK? Is food a material noun, a common noun or a collective noun? In dictionaries, we sometimes see the plural form 'foods'. In this case, was 'food' used as a common noun?)

2 answers

1 and 2 are about the same; 2 is the more commonly used expression.

The word "food" is not generally used in the plural form since it's something of a collective noun anyway.
http://dictionary.reference.com/browse/food

So keep 4 and delete 3. Or, even better, you could write, "We bought a great deal of food." Or "We bought many types of food."
Number 2 is better than number 1.

Both 3 and 4 are correct. Number 3 implies a wide variety of food. Number 4 implies a large quantity of food.

Food is both a material and a common noun.