Insert the Solaris 10 DVD (or CD 1) and boot the system (ensure BIOS is set to boot from CD before HD).
When the installation prompt appears type
b -s
This will boot off the CD-ROM in single user mode.
Then...
Assuming that your root slice is /dev/dsk/c0d0s0
Mount
mount /dev/dsk/c0d0s0 /mnt
Then edit the shadow file
vi /mnt/etc/shadow
Remove the root password from this file
i.e. change
root:blahblahblah:whatever::::::
to
root::whatever::::::
and save the file.
Unmount
umount /mnt
Reboot
shutdown -y -g0 -i6
Remember to remove the DVD/CD as the system reboots
Once the system comes up, you'll be able to log in as root with no password, and enter a new password with the passwd command.
EDIT: Just noticed the OP is using Solaris 9, not 10. Same procedure applies....
Cheers
ZB