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?)

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.

1. Yes, both statements are essentially conveying the same message. Solar energy is considered to be an infinite resource because it is derived from the continuous nuclear fusion reactions happening in the Sun. As long as the Sun exists, solar energy will keep being generated.

To answer the second question:

2. "We bought many foods" is incorrect. Usually, "food" is used as a non-count or mass noun, meaning it doesn't have a plural form. It refers to something that cannot be easily separated or counted individually. In this case, the correct sentence would be: "We bought much food."

However, there are some cases where "foods" can be used, but it generally refers to different types or categories of food rather than the food itself. For example, "The supermarket offers a wide variety of foods, including fruits, vegetables, meats, and baked goods." In this context, "foods" is used as a plural to refer to different food items or categories.

In general, "food" is considered a common noun, which is a noun that represents a general category of things rather than a specific item.