A brain-computer interface was used to read the thoughts of patients to answer basic yes-or-no questions.
One man was able to repeatedly refuse permission for his daughter to get married.
The study on four patients in Switzerland - published in PLOS Biology - also showed they were happy despite the effects of being "locked-in".
The patients all had advanced forms of amyotrophic lateral sclerosis, in which the brain loses the ability to control muscles.
It eventually traps people in their own body - they are able to think, but incapable of moving or talking.
When they become "locked in", it can still be possible to develop ways of communication using eye movements.
But all the patients in the study, at the Wyss Center in Switzerland, were "completely locked in" and could not even move their eyes.
The activity of brain cells can change oxygen levels in the blood, which in turn changes the colour of the blood.
And scientists were able to peer inside the brain using light to detect the blood's colour, through a technique called near-infrared spectroscopy.
They then asked the patients yes-or-no questions such as: "Your husband's name is Joachim?" to train a computer to interpret the brain signals.
The system achieved an accuracy of about 75%.
It means questions need to be asked repeatedly in order to be certain of a patient's answer.
Prof Ujwal Chaudhary, one of the researchers, told BBC News: "It makes a great difference to their quality of life.
"Imagine if you had no means of communicating and then you could say yes or no - it makes a huge impact."
In one case a daughter wanted the blessing of her completely locked-in father before marrying her boyfriend.
But eight times out of 10 the answer came back no.
"We don't know why he said no," said Prof Chaudhary.
"But they got married… nothing can come between love."
The form of communication is being used for more practical day-to-day means such as finding out if patients are in pain or want a family visit.
Prof John Donoghue, the director of the Wyss Center, told the BBC: "If a person who is totally locked-in is able to communicate, you're freeing the mind to interact with the world around them.
"That is remarkable."