There is no problem at all for a Muslim male to pray while barefooted. The absolute minimum attire for the validity of salah (prayer) in case of males is to cover the body from navel to knee (that is, covering the `awrah). In the case of a female, the issue is different. Though it is subject to differences among Muslim scholars, it is preferable for a woman to cover her fee while praying.
In this regard, the late Muslim scholar Dr. Fu`ad Mukhaymar, professor of Islamic studies at Al-Azhar University, states: “A Muslim woman is required to perform prayer while wearing baggy clothes in order to ensure covering all her body with the exception of face and hands. It is also required that during prayer the clothing of the Muslim woman should cover Her ankles.
It is preferable that a woman prays while wearing socks that cover her ankles along with her feet. However, if a woman is sure that no non-Mahram (marriageable man) will enter the place where she prays, then there will be no wrong in praying without wearing socks. In this case also, there will be no wrong in praying while her feet being uncovered.
On the other hand, if she is in doubt that a non-Mahram may enter the place where she prays, then she is required to wear the socks to cover her ankles.”