From Advaita, the refutation is simple. Charvaka believes only in perception as a pramana. Earth appears flat based on perception. Sun appears to set and rise but actually it does not. [These were arguments given at that time as no one could visit space and see that the Earth was spherical etc.] Even in material aspects, perception as pramana is faulty. Therefore, for things that are adrishta (not visible), we believe in sabdha pramana (based on Vedas).
Let us see what Shankara says in his book sarva siddhanta sangraha. The following is the refutation by the Vaisheska school and Shankara agrees with this.
- Now, the Vaisheshka, who upholds the teachings of the Vedas, refutes (the position of) the Bauddhas, the Lokyatikas (Charvakas) and the
Arhatas (Jains), who are all atheistic and outside the pale of the Vedas.
- The Vedas alone constitute (as revealed scripture) the authoritative criterion of truth. According to the logic of
elimination, He alone is to the individual souls the giver of the
fruits of (their) works.
- The individual souls, or (their) works, or prakrti (nature), are not capable of bestowing here (in this world ) the fruits of works on
individual souls.
- If individual souls be themselves capable of obtaining the fruits of works, then let them, being such as are (naturally) devoted to
their own happiness, prevent by means of (their own) efforts the
unwished-for miseries (that often befall them).
- Works (karma*) are here incapable of bestowing their own fruits on individual souls ; because they (the works) are nonintelligent, and so
have no access to (the power to bestow) svarga and other such regions
as are (won as) the fruit of works.
6. Owing to its being lion-intelligent, it is impossible for the prakrti (also) to be the giver of the fruits (of karma).
- Time also is non-intelligent, and so it surely cannot bestow on them (the individual souls) the fruits of their karma. Therefore
(some) other Being, who is different from all these, happens to be the
giver of the fruits (of karma ).
Next, an example is given, if a yagna called Kariristhi is performed, rain falls. As this happens, it becomes necessary to place faith in those - invisible things (known as) svarga (heaven) and apavarga (the final bliss of soul-deliverance). As one part of the Vedas (performing yagnas and getting rain) is found to be true by experience, the other part talking about heaven and moksha must also be true.
The details of the kariristhi yagna can be found.
In his book, Hindu Dharma, Kanchi periyava gives a modern day example
"Leave aside the question of God consigning a man to eternal hell
after his death, " I said to the foreign lady. "We are not witness to
such a phenomenon. But now you have seen with your own eyes how
differently the children are born in the hospital that you visited.
How would you account for the differences? Why should one child be
born rich and another poor? Why should one be healthy and another
sickly? And why should one be good-looking and another not so good
looking?
"If you accept the doctrine that men are born only once, you cannot
but from the impression that God is neither compassionate nor
impartial- think of all the differences at birth- and that he
functions erratically and unwisely. How are we to be devoted to such a
God and have the faith that he will look on us with mercy? How are we
to account for the differences between one being and another if we do
not accept the doctrine that our life now is determined by the good
and the bad we did in our past births. " The lady from the West
accepted my explanation.
Such an explanation is not, however, good enough for people in modern
times.