Thank you for your query at DoctorSpring.com
I understand your concern.
Especially in a sport like basketball, leg injuries ( hamstring sprain, quadriceps pull ) are common. If you have sprained a muscle the pain is going to stay and gradually increase over the first 3 days, then subside. Since it's hurting more while you're laying down, it is likely to be the muscle around your hips, since they are stretched while you lay down, and that can aggravate the pain.
It can be relieved by simple anti inflammatory medication like Tab. Advil 400 mg twice a day after food. If the pain is unbearable it can be takn thrice a day at 6 hour intervals. Kindly continue the medicine for a couple of days, and get back to me with an update.
Hope this was helpful,