They ran out of oil.

They ran out of food.
They ran out of rice.
They ran out of money.
They ran out of pens.
He ran out of paper.
He ran out of grocery.
The food is running out.
The oil is running out.
The rice is running out.
His money is running out.

(Are they all grammatical? By the way, what is the meaning of 'out' in the sentences?)

He ran out of groceries. (It is plural).

To "run out" is an idiom that means to be completely gone. The words have to be considered together.

http://www.idiomsite.com/#r

Here's another website that explains "phrasal verbs" -- that is verbal phrases whose words always go together to produce a particular meaning:

http://www.eslcafe.com/pv/
from http://www.eslcafe.com/ >> Stuff for Students

Yes, all of the sentences you provided are grammatically correct.

In these sentences, the word "out" is used as a preposition to indicate the depletion or exhaustion of a particular resource. It means that there is no more of that particular item available or remaining.

For example:
- "They ran out of oil" means that the supply of oil has been completely used up or depleted.
- "He ran out of grocery" implies that the person has run out of essential food items or supplies that are typically found in a grocery store.
- "The food/oil/rice is running out" indicates that there is a limited amount of food, oil, or rice remaining, and it is gradually being consumed or used up.

In general, using "out" in this way conveys the idea of scarcity or the absence of a resource, emphasizing that there is nothing remaining or available.