The Baital-Pachisi, or Twenty-five Tales of a Baital is the history of a huge Bat, Vampire, or Evil Spirit which inhabited and animated dead bodies. It is an old, and thoroughly Hindu, Legend composed in Sanskrit, and is the germ which culminated in the Arabian Nights, and which inspired the "Golden Ass" of Apuleius, Boccacio's "Decamerone," the "Pentamerone," and all that class of facetious fictitious literature.- Isabel Burton, in preface to her husband Richard R. Burton's translation of Baital-Pachisi titled 'Vikram and The Vampire'.
The story turns chiefly on a great king named Vikram, the King Arthur of the East, who in pursuance of his promise to a Jogi or Magician, brings to him the Baital (Vampire), who is hanging on a tree. The difficulties King Vikram and his son have in bringing the Vampire into the presence of the Jogi are truly laughable; and on this thread is strung a series of Hindu fairy stories, which contain much interesting information on Indian customs and manners. It also alludes to that state, which induces Hindu devotees to allow themselves to be buried alive, and to appear dead for weeks or months, and then to return to life again; a curious state of mesmeric catalepsy, into which they work themselves by concentrating the mind and abstaining from food[...]
Baital-Pachisi is generally attributed to 8th-century Sanskrit sage Bhavabhuti who wrote 'Vetala-panchvimshati'. Kalhana, the 12th century Kashmiri historian, places Bhavabhuti in the entourage of the King Yashovarman of Kanauj, who was defeated by Lalitaditya, King of Kashmir, in 736 AD. Vikram of the tale is supposed to be Vikramaditya (102 BCE to 15 CE) the legendary king of Ujjain.
Baital-Pachisi was also a part (ninth section of twelfth book ) of 11th century AD (between 1063 and 1081 AD+) mammoth Sanskrit text Katha Sarit Sagara 'Ocean of the streams of narrative' by a Kashmiri poet-scholar named Somadeva. Somadeva in turn had found the stories in Brhat Katha or Vrihat Katha ('Long Story' 'Tale-Epic') a still more ancient (6th century AD and earlier* and now lost) work in Paisaci language (often translated as 'Language of Blood sucking Ghouls') by one Gunadhya who in turn may have based his stories on still more ancient sources. In Brhat Katha:
An introductory story presumptively describes the life and adventures of Udayana, a king of Vatsa, and those of his wives Vasavadatta and Padmavati and the birth of his son Naravahanadatta. Then the main story describes the adventures of Naravahanadatta, how he gets a large number of wives and how he becomes the lord of Vidyadharas-half-divine beings, who participate in prosperity and adversity of man more than another divinities do. *A Sanskrit translation* of Brhat Katha became Katha Sarit Sagara.
Somadeva's stories from Katha Sarit Sagara started when:
[...] no less a person than the deity Siva, who, it is said, related them in private conversation with his wife, Parvati, for her entertainment. One of the attendants of the god, Pushpadanta, took the liberty of listening, and he repeated them, under the seal of secrecy, to his wife, Jaya, a sort of lady's maid to the goddess. What woman, says the author, can restrain her tongue ? Jaya takes an opportunity of intimating to her mistress that she is acquainted with the stories narrated by Siva, to the great mortification of Parvati, who had flattered herself that they had been communicated to her alone. She accordingly complains to Siva of his having deceived her, and he vindicates himself by discovering the truth. Parvati thereupon pronounces an imprecation upon Pushpadanta, condemning him to be born upon the earth as a man; and she sentences his friend Malyavan, who had ventured to intercede for him, to a like destination. The infliction of this punishment is a not uncommon fate of the subordinate divinities of the Hindus, when they incur the displeasure of the Dii majores, or even of holy sages. The degradation, however, endures only for a season, and terminates upon the occurrence of some preannounced catastrophe. On the present occasion, Parvati tells the culprits that they shall resume their celestial condition when Pushpadanta, encountering a Yaksh, a follower of Kuvera, the god of wealth, " doom'd for a certain time to walk the earth," as a Pisacha or goblin, shall recollect his own former state, and shall repeat to the Pisacha the stories he overheard from Siva; and when Malyavan, falling in with the Pisacha, shall hear from him again the stories that his friend Pushpadanta had narrated. The recitation of the stories forms also the limit of the Yaksha's sojourn amongst mortals. This machinery is of course exclusively Hindu.
The two demigods, Pushpadanta and Malyavan, are born as two Brahmans, named Vararuchi and Gunadhya, and their adventures as mortals constitute the subject of several tales. Some of these possess much local interest: we have in them literary anecdotes relating to celebrated works and authors, as to Panini the grammarian ; notices of historical persons and events, as of the accession of Chandragupta or Sandrocoptus; and traditions of the origin of celebrated places, as of that of Palibothra already alluded to. The circumstances of these narratives are marvellous, it is true, and are not to be received as facts. In the absence of all authentic history and biography, however, they are not without interest, and perhaps not without value; and in the place in which they are found they are evidence of the early date at which popular belief assented to legends still current.
We find also in this portion of the work various incidents and tales which are of wide dissemination. One of the best told stories in the whole work occurs here. Upakosa, the wife of Vararuchi, becomes, during the absence of her husband, the object of the addresses of the king's family priest, the commander of the guards, the prince's tutor, and her husband's banker. She makes assignations with them all: each as he arrives is quickly followed by his successor, and is secreted only to be finally exposed and punished. The story is the same in all essential respects as that of the Lady of Cairo and her four gallants, in Scott's additional Arabian Nights; and that of the merchant's wife and her suitors in the tale of the king, his favourite, 'and the seven vizirs, translated by the same orientalist. It is also that of Arouya in the Persian tales; and it is also found as a Fabliau, that of Constant du Hamel, or ' la dame qui attrapa un Pretre, un Prevot et un Forestier,' (Fabl. de Le Grand, iv. p. 246); and it is worthy of remark, that the Fabliau alone agrees with the Hindu original in the mode of putting the suitors out of the way, by hiding them in baskets and disrobing them under the plea of a bath.
There is in this part of the work some very curious matter, the purport of which it is not easy to conjecture, unless it conceal an intimation that the stories are of inferior, if not of foreign origin. Malyavan, or Gunadhya, in consequence of a dispute with a rival Brahman, forgoes the use of the Sanscrit, Prakrit and Desya, or vernacular languages. He afterwards learns the Paisachi language, or that of the goblins, which enables him to receive the narrations as they are told him by the metamorphosed Yaksha or Pisacha. Possibly the author thought some contrivance necessary to explain how the Pisacha should be intelligible to the Brahman, and nothing more is meant than meets the eye; but a hypothesis might be framed upon it, that the stories were translations, whence made, it would not be easy to explain, unless we call in Pehlevi, a language extinct or disused before the Katha Sarit Sagara was compiled. However this may be, Gunadhya having heard the stories, extending to seven hundred thousand stanzas, wrote them with his blood, for there was no ink in the forest. He then offered the work to Satavahana, king of Pratishthana, who rejected it with abhorrence, on which the author kindled a fire in the forest, and reading it aloud, to the great edification of spirits and goblins, and birds and beasts, he burned it leaf by leaf as he finished the perusal. The news of this proceeding at last reached the king, and he repented of what he had done, and repaired to Gunadhya to solicit the gift of the work. The sage consented to present the king with the hundred thousand verses that had not yet been consigned to the flames. Satavahana took it to his capital, and having received an explanation of it from two of Gunadhya's disciples, he translated it from the language of the Pisachas. Satavahana, as king of Pratishthana, it may be observed, is identifiable with the Salivahana, whose reign, A.d. 78, forms an epoch in the ordinary chronology of the Hindus. It would seem as if tradition ascribed to him the patronage of this class of composition, and there is nothing very improbable in the supposition that the golden age of Indian fabling dates about the commencement of the Christian era.+
(King Bhartri Hari also makes an appearance in one of the 25 stories from Vetala-panchvimshati)
An interesting point to note is that in Kashmirian Vetalapanchavirhsati of Somadeva's version of Brhat Katha, the hero, the King is called 'Trivikramasena, the son of Vikramasena' ** but still refers to the semi-legendary Vikrama or Vikramaditya of Jain tradition.
A 1960s (?) Kashmiri production of Baital Pachisi for Radio Kashmir retained the name 'Trivikramasena'.
'Wan Raaz Trivikramasen, Answer King Trivikramasen,' with this line Baital would needle king into answering his trick questions.
For the late 1980s popular Indian television series 'Vikram aur Betaal', its makers, used the narrative of Somadeva.
+"At the close of it, the author, Somadeva, states that he compiled it at the desire of Suryavati, a dowager queen of Kashmir, for the amusement and instruction of her grandson, Harsha Deva, whilst under her guardianship. Harsha Deva reigned, as Professor Brockhaus mentions, about A.d. 1125; but the Chronicles of Kashmir, the Raja Tarangini, give us more exactly the time. Harsha Deva was, according to Somadeva's genealogy of him, the son of Kalasa, the son of Ananta, the son of Sangrama, kings of Kashmir in succession. The Raja Tarangini has the same series of descents, and both authorities designate Suryavati as the wife of Ananta, mother of Kalasa and grandmother of Harsha. The period assigned for the joint reigns of Harsha's three predecessors in the RajaTarangini is seventy six years. Abulfazl has the same names ; but in Gladwin's translation of the Ayin Akberi, the aggregate of the three reigns is but thirty-one years. The MSS. of the work are however, in the chronological tables which they contain, exceedingly incorrect. Didda Rani, the predecessor of Sangrama, died A.D..1025 (Asiatic Researches, vol. xv. p. 80), and seventy-six years added to this places Harsha's accession A.d. 1101. According to the Kashmir Chronicle, however, Suryavaii burnt herself with her husband Ananta's dead body eight years before, or in A.d. 1093. The compilation of the Katha Sarit Sagara must have preceded this event by some few years, so that we cannot be far wrong in assigning it to about A.d. 1088, to which therefore we fix the most modern limit of all the stories found in the compilation. The Katha Sarit Sagara then, considered in itself, and still more especially as the representative of a still earlier composition, the Vrihat Katha, is the oldest extant assemblage of tales, except the Hindu original, and the first translation of the Kalila and Dimna [ Panchatantra], and it is therefore indispensable to the history of fiction to determine what it contains."-The British and foreign review: or, European quarterly journal, Volume 11,1840. Offers a concise account of Katha Sarit Sagara.
History of Indian literature by Moriz Winternitz, Subhadra Jha, Volume 3, Page 348. Ksemendra's Brhatkathamanjari, 'Bud (of the tree) of the Brhatkatha)' from around 1037AD, written about 30 years prior to Somadeva's Katha Sarit Sagara was another Kashmirian version of Brhat katha. Only other version survives (in part) in Nepalese work Brhatkatha-Slokasangraha by Buddhasvamin.
** The ocean of story, being C.H. Tawney's translation of Somadeva's Katha sarit sagara (or Ocean of streams of story) (1924) [Read at Archive.org]
You may also like to read:
Vikram and The Vampire by Sir Richard R. Burton
Classic Hindu Tales of Adventure, Magic, and Romance
Edited by his Wife Isabel Burton 
Twenty-five stories of a demon
By Duncan Forbes, Ghulam Mohammad (Munshi.), 1868
Image: Classic 'Vikram Betal' image from of Chandamama, January 1982 [Check out the archives of Chandamama]