There are both legal and practical issues related to possessing a firearm in the United States for nonimmigrant aliens (visitors from other countries who are not attempting to migrate to the United States). The rules are complex and are dependent on your country of origin.
Here is a document from the Bureau of Alcohol, Tobacco, Firearms and Explosives which gives a rather complex explanation to the issue.
If you are admitted to the United States under a nonimmigrant alien visa then you may not possess a firearm unless you meet a certain set of exceptions. Two of those exceptions are you must have a hunting license issued by a government entity within the United States or be admitted to the United States for lawful hunting or sporting purposes.
If you are a nonimmigrant alien without a visa (e.g. your country participates in the Visa Waiver Program) then you may possess a firearm in the United States provided that you are not otherwise prohibited from doing so (typically a convicted criminal, mental defective or drug user).
There are also ITAR (International Traffic in Arms Regulations) rules that prevent anyone in the United States from providing instruction in the use of firearms to nonresident aliens. This is a little-known regulation that can get someone teaching about firearms in deep trouble.
Most gun ranges, especially in California, will not rent a firearm to a single person in order to reduce the probability of suicide. There was a rash of suicidal people who visited gun ranges, rented a gun and then shot themselves about 20 years ago. You'll now find that gun ranges as part of a "best-practices" approach to policies will no longer rent a firearm to a person who is alone and didn't already bring a firearm.
That's the legal stuff. I'm not a lawyer and can't and won't provide legal advice. I am, however, a professional firearms instructor and am in constant concern about keeping my business dealings legal.
From a practical perspective it is unlikely you will run into any problems unless you create problems. Assuming you are permitted to possess a firearm then you are legally allowed to rent a gun at a range and shoot all day long, if the range will rent you the gun.
Under current interpretation of ITAR it would be illegal for anyone to teach you about the gun, its operation or, probably even gun safety. Of course, nothing prevents you from watching any of the gun-related instructional videos on YouTube. From an advice perspective, this last part has me the most concerned. All of my students get very detailed instruction on gun safety and close supervision until I'm sure they can operate their firearm in a safe manner.
Please note that this answer only pertains to U.S. federal law. As others have pointed out in the comments one also has to be aware of individual state laws and regulations.