The illustrious Bhishma, who had mastery of Yoga, went into deep meditation, during his last moments.Bhishma did not feel any pain even though lying on a bed of arrows.As said by Bhishma:-
कर्मणा मनसा वापि वाचा वापि परंतप
यन मे कृतं बराह्मणेषु तेनाद्य न तपाम्य अहम
Karmana Manasa Vapi Vacha Vapi Parantap
Yen Mei Kratam Brahmaneshu Teinadhya Na Tapaamya Aham
Translation
In consequence of what I have done to the Brahmanas in thought, word, and deed, I do not feel any pain now (even though I am lying on a bed of arrows).
Mahabharata Book 13 Chapter 8 Shloka 16
The details of the yogic manner of departure of Bhishma’s soul, and the last rites, are explained hereunder.
(1)The entire body of Bhishma became shaftless and soreless.
(i)Bhishma, the son of Santanu, remained silent for sometime, O chastiser of foes
(ii)He then held forth his life-breaths successively in those parts of his body which are indicated in Yoga. The life-breaths of that high-souled one, restrained duly, then rose up.
(iii)Those parts of the body of Santanu's son, in consequence of the adoption, of Yoga, from which the life-breaths went up, became soreless one after another.
(iv)Within a short time, the entire body of Bhishma became shaftless and soreless.
(2)The illustrious Bhishma united himself with eternity.
(i)The life-breaths, restrained and unable to escape through any of the outlets, at last pierced through the crown of the head and proceeded upwards to heaven.
(ii)The life-breaths of Bhishma, piercing through the crown of his head, shot up through the welkin like a large meteor and soon became invisible.
iii)Even thus, O great king, did Santanu's son, that pillar of Bharata's race, united himself with eternity.
(3)Funeral pyre was prepared by Vidura and the Pandavas.
Then the high-souled Pandavas and Vidura, taking a large quantity of wood and diverse kinds of fragrant scents, made a funeral pyre.
(4)Cremation of the body.
(i)The Pitri sacrifice of the high-souled Bhishma was then duly performed. Many libations were poured upon the sacred fire. The singers of Samans sang many Samans.
(ii)Then covering the body of Ganga's son with sandal wood and black aloe and the bark wood, other fragrant fuel, and setting fire to the same, the Kurus with Dhritarashtra and others, stood on the right sight of the funeral pyre.
(5)Sacred ceremony and oblation of water, at the banks of river Ganga
Those foremost ones of Kuru's race, having thus cremated the body of the son of Ganga, proceeded to the sacred Bhagirathi, accompanied by the Rishis.
All of them, arrived at the sacred river, duly offered oblation of water unto the high-souled son of Ganga.
(6)Goddess Ganga makes her appearance.
The goddess Bhagirathi, after those oblations of water had been offered by them unto her son, rose up from the stream weeping and distracted by sorrow, for her son.
(7)Lord Sri Krishna consoled goddess Ganga
The puissant Krishna, hearing the goddess of the great river indulging in these lamentations consoled her with many soothing words.
(8)Completion of last rites ceremony
All the kings there present, headed by Krishna, O monarch, having honoured that goddess duly, received her permission to depart from her banks.
Reference-Mahabharata Book:13, Anusasana Parva,Anusasanika Parva.