smartphone as a USB ramdisk
USB Share does the trick by creating a virtual usb image in /mnt/secure (which is mounted as tmpfs on my Android 4.2 OS). Then, mount and share the image with RW permissions.

Side note:
i've found my OS also mounts a tmpfs on /sdcard/.android_secure but when connected as USB mass storage the files get written on the flash memory instead of the tmpfs.

If you know a better solution not requiring any commercial app please let me know!